예제 #1
0
파일: UserRole.php 프로젝트: bengor/user
 /**
  * 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());
 }
예제 #2
0
파일: User.php 프로젝트: 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);
 }