public function getRole($roleName)
    {
        switch ($roleName) {
            case self::ROLE_ANONYMOUS:
                return [
                    'label'       => Trans::__('permissions.roles.label.anonymous'),
                    'description' => Trans::__('permissions.roles.description.anonymous'),
                    'builtin'     => true,
                ];

            case self::ROLE_EVERYONE:
                return [
                    'label'       => Trans::__('Everybody'),
                    'description' => Trans::__('permissions.roles.description.everyone'),
                    'builtin'     => true,
                ];

            case self::ROLE_OWNER:
                return [
                    'label'       => Trans::__('permissions.roles.label.owner'),
                    'description' => Trans::__('permissions.roles.description.owner'),
                    'builtin'     => true,
                ];

            default:
                $roles = $this->getDefinedRoles();
                if (isset($roles[$roleName])) {
                    return $roles[$roleName];
                }

                return null;
        }
    }
public function getRole($roleName)
    {
        switch ($roleName) {
            case self::ROLE_ANONYMOUS:
                return [
                    'label'       => Trans::__('permissions.roles.label.anonymous'),
                    'description' => Trans::__('permissions.roles.description.anonymous'),
                    'builtin'     => true,
                ];

            case self::ROLE_EVERYONE:
                return [
                    'label'       => Trans::__('Everybody'),
                    'description' => Trans::__('permissions.roles.description.everyone'),
                    'builtin'     => true,
                ];

            case self::ROLE_OWNER:
                return [
                    'label'       => Trans::__('permissions.roles.label.owner'),
                    'description' => Trans::__('permissions.roles.description.owner'),
                    'builtin'     => true,
                ];

            default:
                $roles = $this->getDefinedRoles();
                if (isset($roles[$roleName])) {
                    return $roles[$roleName];
                }

                return null;
        }
    }
public function getRole ( $ roleName ) { switch ( $ roleName ) { case self :: ROLE_ANONYMOUS : return [ 'label' => Trans :: __ ( 'permissions.roles.label.anonymous' ) , 'description' => Trans :: __ ( 'permissions.roles.description.anonymous' ) , 'builtin' => true , ] ; case self :: ROLE_EVERYONE : return [ 'label' => Trans :: __ ( 'Everybody' ) , 'description' => Trans :: __ ( 'permissions.roles.description.everyone' ) , 'builtin' => true , ] ; case self :: ROLE_OWNER : return [ 'label' => Trans :: __ ( 'permissions.roles.label.owner' ) , 'description' => Trans :: __ ( 'permissions.roles.description.owner' ) , 'builtin' => true , ] ; default : $ roles = $ this -> getDefinedRoles ( ) ; if ( isset ( $ roles [ $ roleName ] ) ) { return $ roles [ $ roleName ] ; } return null ; } }
Gets meta-information on the specified role.

@param string $roleName

@return array An associative array describing the role. Keys are:
- 'label': A human-readable role name, suitable as a label in the
backend
- 'description': A description of what this role is supposed to do.
- 'builtin': Optional; if present and true-ish, this is a built-in
role and cannot be overridden in permissions.yml.
Gets meta - information on the specified role .