Nette\Security\Permission::hasRole PHP Метод

hasRole() публичный Метод

Returns TRUE if the Role exists in the list.
public hasRole ( $role ) : boolean
Результат boolean
    public function hasRole($role)
    {
        $this->checkRole($role, FALSE);
        return isset($this->roles[$role]);
    }

Usage Example

Пример #1
0
 public function isAllowed($role = IAuthorizator::ALL, $resource = IAuthorizator::ALL, $privilege = IAuthorizator::ALL)
 {
     if (!$this->acl->hasRole($role)) {
         $this->onUndefinedRole($role);
     }
     if (!$this->acl->hasResource($resource)) {
         $this->onUndefinedResource($resource);
     }
     return $this->acl->isAllowed($role, $resource, $privilege);
 }
All Usage Examples Of Nette\Security\Permission::hasRole