Webiny\Component\Security\Role\Role::getRole PHP 메소드

getRole() 공개 메소드

Returns the name of the role.
public getRole ( ) : string
리턴 string
    public function getRole()
    {
        return $this->role;
    }

Usage Example

예제 #1
0
 /**
  * This function is called before we ask the voter to vote.
  * The voter will get a list of user roles, and can loop through it to check if it supports the roles, eg. based
  * on their prefix.
  * If the voter returns false, we will not ask him to vote, if it returns true, the voter must vote.
  *
  * @param Role $role A Role instances that the current route requires.
  *
  * @return bool
  */
 public function supportsRole(Role $role)
 {
     return $this->str($role->getRole())->startsWith('ROLE_');
 }
All Usage Examples Of Webiny\Component\Security\Role\Role::getRole