Overview

Namespaces

  • None
  • PHP
  • Pry
    • Auth
      • Interfaces
    • Config
    • Controller
    • Date
    • Db
    • Feed
      • Abstracts
      • Writers
    • File
      • Decorator
    • Form
      • Element
    • Image
    • Log
      • Writer
    • Net
      • Exception
    • Session
    • Util
    • Validate
      • Validator
    • View

Classes

  • ACL
  • Auth
  • Bcrypt
  • Util
  • WithRole
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: /**
 4:  * Pry Framework
 5:  *
 6:  * LICENSE
 7:  *
 8:  * This source file is subject to the new BSD license that is bundled
 9:  * with this package in the file LICENSE.txt.
10:  * 
11:  */
12: namespace Pry\Auth;
13: 
14: use Pry\Auth\ACL;
15: /**
16:  * Classe abstraite à étendre par toute classe utilisateur souhaitant utiliser les roles/permissions
17:  * @package Auth
18:  * @category Pry
19:  * @version 1.0.1
20:  * @author Olivier ROGER <oroger.fr>
21:  *
22:  */
23: abstract class WithRole
24: {
25:     /** @var Pry\Auth\ACL */
26:     protected $ACL;
27:     
28:     /**
29:      * Défini l'objet d'ACL gérant les roles et permissions
30:      * @param Auth_ACL $acl L'objet ACL 
31:      */
32:     abstract public function setACL(ACL $acl);
33:     
34:     /**
35:      * Peuple l'objet ACL avec les roles et permissions associés à l'utilisateur 
36:      */
37:     abstract public function populateACL();
38: 
39: 
40:     /**
41:      * Vérifie si l'utilisateur possède la permission
42:      * @param string $perm Nom de la permission
43:      * @return boolean 
44:      */
45:     public function hasPermission($perm)
46:     {
47:         return $this->ACL->hasPermission($perm);
48:     }
49: }
50: 
51: ?>
52: 
Pry API documentation generated by ApiGen 2.8.0