Scalr\Model\Entity\Account\User::isAccountSuperAdmin PHP Method

isAccountSuperAdmin() public method

Checks if the user is account admin
public isAccountSuperAdmin ( ) : boolean
return boolean Returns true if user is account super admin
    public function isAccountSuperAdmin()
    {
        return $this->type == self::TYPE_ACCOUNT_SUPER_ADMIN;
    }

Usage Example

コード例 #1
0
ファイル: User.php プロジェクト: mheydt/scalr
 /**
  * Checks whether the user is allowed to edit specified user
  *
  * @param   User     $user The user to edit
  * @return  boolean  Returns true if the user is allowed to edit specified user
  */
 public function canEditUser(User $user)
 {
     return !$this->isTeamUser() && $user->accountId == $this->accountId && ($this->id == $user->id || $this->isAccountOwner() || $this->isAccountSuperAdmin() && !$user->isAccountOwner() || $this->isAccountAdmin() && !$user->isAccountOwner() && !$user->isAccountSuperAdmin());
 }