Overview

Packages

  • Auth
  • Config
  • Controller
  • Date
  • Db
  • Feed
    • Abstract
    • Writers
  • File
    • Decorator
  • Form
    • Element
  • Image
  • Log
    • Writer
  • Net
    • Exception
  • None
  • PHP
  • PHPMailer
  • Session
  • Util
  • Validate
    • Validator
  • Zend
    • Registry

Classes

  • Auth_ACL
  • Auth_Auth
  • Auth_Bcrypt
  • Auth_Util
  • Auth_WithRole
  • Overview
  • Package
  • 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:  * @version $Revision: 276 $
12:  */
13: 
14: /**
15:  * Classe abstraite à étendre par toute classe utilisateur souhaitant utiliser les roles/permissions
16:  * @package Auth
17:  * @category Pry
18:  * @version 1.0.1
19:  * @author Olivier ROGER <oroger.fr>
20:  *
21:  */
22: abstract class Auth_WithRole
23: {
24:     /** @var Auth_ACL */
25:     protected $ACL;
26:     
27:     /**
28:      * Défini l'objet d'ACL gérant les roles et permissions
29:      * @param Auth_ACL $acl L'objet ACL 
30:      */
31:     abstract public function setACL(Auth_ACL $acl);
32:     
33:     /**
34:      * Peuple l'objet ACL avec les roles et permissions associés à l'utilisateur 
35:      */
36:     abstract public function populateACL();
37: 
38: 
39:     /**
40:      * Vérifie si l'utilisateur possède la permission
41:      * @param string $perm Nom de la permission
42:      * @return boolean 
43:      */
44:     public function hasPermission($perm)
45:     {
46:         return $this->ACL->hasPermission($perm);
47:     }
48: }
49: 
50: ?>
51: 
Pry Framework API documentation generated by ApiGen 2.6.1