Pimcore\Model\User::isAdmin PHP Метод

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

См. также: getAdmin()
public isAdmin ( ) : boolean
Результат boolean
    public function isAdmin()
    {
        return $this->getAdmin();
    }

Usage Example

Пример #1
0
 /**
  * Returns whether or not a user can perform an action
  * if a status is given then it will be taken into consideration
  * @param      $actionName
  * @param null $statusName
  * @return bool
  * @throws \Exception
  */
 public function userCanPerformAction($actionName, $statusName = null)
 {
     if (!$this->user) {
         throw new \Exception('No user is defined in this Workflow Manager!');
     }
     if ($this->user->isAdmin()) {
         return true;
     }
     $requiredUserIds = $this->workflow->getValidUsersForAction($actionName, $statusName);
     if ($requiredUserIds === null) {
         return true;
     }
     foreach ($requiredUserIds as $id) {
         if (in_array($id, $this->userIds)) {
             return true;
         }
     }
     return false;
 }
All Usage Examples Of Pimcore\Model\User::isAdmin