Ejemplo n.º 1
0
 /**
  * Returns all Permissions for this Role.
  *
  * The Permissions are only read from the DB when needed the first time.
  *
  * @return array An array of Permission objects.
  */
 public function permissions()
 {
     if (!$this->permissions) {
         $this->permissions = array();
         foreach (RolePermission::findPermissionsFor($this->id) as $perm) {
             $this->permissions[$perm->name] = $perm;
         }
     }
     return $this->permissions;
 }