Beispiel #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());
 }
Beispiel #2
0
 /**
  * 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);
 }