Exemplo n.º 1
0
 /**
  * Method that checks if the user role given is equal to the current.
  *
  * @param UserRole $aRole The user role
  *
  * @return bool
  */
 public function equals(UserRole $aRole)
 {
     return strtolower($this->role) === strtolower($aRole->role());
 }
Exemplo n.º 2
0
Arquivo: User.php Projeto: bengor/user
 /**
  * Checks if the role given appears between allowed roles.
  *
  * @param UserRole $aRole The user role
  *
  * @return bool
  */
 public function isRoleAllowed(UserRole $aRole)
 {
     return in_array($aRole->role(), static::availableRoles(), true);
 }