Webiny\Component\Security\Role\Role::getRole PHP Method

getRole() public method

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

Usage Example

Ejemplo n.º 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