Advertisement
TheFan1968

ZF3: AccessControlInterface

Apr 26th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <?php
  2. namespace Application\CustomClasses\AccessControl;
  3. use Application\UserModel\UserRepoInterface;
  4. use Zend\Session\Container;
  5.  
  6. interface AccessControlInterface{
  7.     /**
  8.      * Formulareingaben aus einem Login-Formular verarbeiten
  9.      * und Session mit den notwendigen Login Informationen versorgen
  10.      *
  11.      * @param string $name
  12.      * @param string $password
  13.      * @return bool
  14.      */
  15.     public function getLogin(string $name, string $password);
  16.    
  17.     /**
  18.      * Die aktuelle Session beenden und den Logout durchführen
  19.      * @return bool
  20.      */
  21.     public function getLogout();
  22.    
  23.     /**
  24.      * Den in der Session gespeicherten Login-Key auf seine Gültigkeit überprüfen
  25.      * und bei fehlender Übereinstimmung ausloggen
  26.      *
  27.      * @param string $loginkey
  28.      * @return bool
  29.      */
  30.     public function checkLoginStatus(string $loginkey);
  31.    
  32.     /**
  33.      * Injection des User-Repositories
  34.      * @param UserrRepoInterface $repo
  35.      */
  36.     public function setUserRepo(UserRepoInterface $repo);
  37.    
  38.     /**
  39.      * Injection der AccessControl List
  40.      * @param AccessControlList $acl
  41.      */
  42.     public function setAclList(AccessControlList $acl);
  43.    
  44.     /**
  45.      * Wrapper für die gleichnamige Funktion der Klasse Acl
  46.      * @param string $resource
  47.      * @param string $privilege
  48.      * @return bool
  49.      */
  50.     public function isAllowed(string $resource=null,string $privilege);
  51.    
  52.     /**
  53.      * Ermittlung der Rolle des Users aus der DB
  54.      * @return string
  55.      */
  56.     public function getUserRole();
  57.    
  58.     /**
  59.      * Den aktuellen Container der Anwendung aus der Session holen
  60.      * @return Container
  61.      */
  62.     public function getApplicationContainer();
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement