Get the current user's roles of the application.

If the user is a guest, empty array should be returned.

@return array
6019
public function roles()
    {
        $user   = $this->user();
        $userId = 0;
        is_null($user) || $userId = $user->getAuthIdentifier();
        $roles  = Arr::get($this->userRoles, "{$userId}", []);
        if (empty($roles)) {
            $roles = $this->getUserRolesFromEventDispatcher($user, $roles);
        }

        Arr::set($this->userRoles, "{$userId}", $roles);

        return $roles;
    }
1027408
public function getRoles()
    {
        $roleModel = new \erdiko\users\models\Role;
        $roleEntity = $roleModel->findById($this->_user->getRole());
		return array( $roleEntity->getName());
	}
1084309
public function getRoles() {

		$roles = [];

		foreach($this -> permissions as $role => $permissions) {
			$roles[$role] = $this -> getRole($role);
		}

		return $roles;
	}
1105231
public function getUserRoles() {
        $returnValue = $this->internalSession->getUserRoles();
        foreach (array_keys($returnValue) as $key) {
            $role = $returnValue[$key];
            if (!in_array($role, $this->filter)) {
                unset($returnValue[$key]);
            }
        }
        return $returnValue;
    }
290909
public function getAllAvailableRoles ()
    {
        return array_filter(
            $this->roleCollection,
            function (BaseRole $role)
            {
                if ($role instanceof Role)
                {
                    return !$role->isHidden();
                }

                //remove all BaseRoles
                return false;
            }
        );
    }
214931
public function getRoleNamesAsArray()
    {

        // initialize the array for the role names
        $roleNames = array();

        // prepare the role names
        /** @var AppserverIo\Appserver\Core\Api\Node\RoleNameNode $roleName */
        foreach ($this->getRoleNames() as $roleName) {
            $roleNames[] = $roleName->__toString();
        }

        // return the array with the role names
        return $roleNames;
    }
236856
public function members() : array
    {
        $members = [];

        if (!isset($this->session->members) || $this->session->memberCount <= 0) return $members;

        foreach ($this->session->members as $member) {
            $members[] = new User($this->client, $member->onlineId);
        }

        return $members;
    }
23625
public function getUsers()
    {
        // get the user list
        return $this->apiCall('users.list')->then(function (Payload $response) {
            $users = [];
            foreach ($response['members'] as $member) {
                $users[] = new User($this, $member);
            }
            return $users;
        });
    }
1147321
public function getRoles()
    {
        return \is_string($value = $this->getContentValue('roles', null))
            ? array_filter(explode(',', (string) $value))
            : null;
    }
810660
public function getGuestList()
    {
        $reservationClass = Reservation::singleton()->getClassName();
        $attendeeClass = Attendee::singleton()->getClassName();
        return Attendee::get()
            ->leftJoin($reservationClass, "`$attendeeClass`.`ReservationID` = `$reservationClass`.`ID`")
            ->filter(array(
                'EventID' => $this->owner->ID
            ))
            ->filterAny(array(
                'ReservationID' => 0,
                'Status' => Reservation::STATUS_PAID
            ));
    }
1247138
public function getRoles()
    {
        $result = array();
        /* @var $role RoleInterface */
        foreach ($this->roles as $role) {
            $result[] = $role->getRole();
        }

        return $result;
    }
1251035
public static function getRoles()
    {
        return [
            self::ROLE_MEMBER => Yii::t('podium/view', 'Member'),
            self::ROLE_MODERATOR => Yii::t('podium/view', 'Moderator'),
            self::ROLE_ADMIN => Yii::t('podium/view', 'Admin'),
        ];
    }
274409
public function getUserGroups()
    {
        $groups = [];
        foreach ($this->adminGroupConfiguration->getGroups() as $groupName) {
            $groups[] = $this->getUserGroup("$groupName");
        }
        $groups[] = $this->getUserGroup('guest');

        return $groups;
    }
32992
protected function getRoles()
    {
        $roles = [];

        foreach ($this->acl->getRolePrivileges() as $role => $privileges) {
            $roles[$role]['role']    = $role;
            $roles[$role]['parents'] = $privileges[\MUtil_Acl::PARENTS]   ? implode(', ', $privileges[\MUtil_Acl::PARENTS])   : null;
            $roles[$role]['allowed'] = $privileges[\Zend_Acl::TYPE_ALLOW] ? implode(', ', $privileges[\Zend_Acl::TYPE_ALLOW]) : null;
            //$roles[$role]['denied']  = $privileges[\Zend_Acl::TYPE_DENY]  ? implode(', ', $privileges[\Zend_Acl::TYPE_DENY])  : null;
            $roles[$role]['inherited'] = $privileges[\MUtil_Acl::INHERITED][\Zend_Acl::TYPE_ALLOW] ? implode(', ', $privileges[\MUtil_Acl::INHERITED][\Zend_Acl::TYPE_ALLOW]) : null;
            //$roles[$role]['parent-denied']  = $privileges[\MUtil_Acl::INHERITED][\Zend_Acl::TYPE_DENY]  ? implode(', ', $privileges[\MUtil_Acl::INHERITED][\Zend_Acl::TYPE_DENY])  : null;
        }
        ksort($roles);

        return $roles;
    }
1137350
public function getCurrentUser()
    {
        if ($this->currentuser === null) {
            $this->currentuser = $this->app['session']->isStarted() ? $this->app['session']->get('authentication') : null;
            if ($this->currentuser instanceof AccessControl\Token\Token) {
                $this->currentuser = $this->currentuser->getUser()->toArray();
            }
        }

        return $this->currentuser;
    }
607575
public function roleListAction()
    {
        $roles = $this->roleManager->getAllPlatformRoles();
        $counts = [];

        foreach ($roles as $role) {
            $counts[$role->getName()] = $this->roleManager->countUsersByRoleIncludingGroup($role);
        }

        return array('roles' => $roles, 'counts' => $counts);
    }
76737
protected function getUsers()
    {
        $qb = $this->registry->getManager()->createQueryBuilder();

        $qb
            ->select('u')
            ->from($this->userClass, 'u')
            ->where($qb->expr()->like('u.roles', ':roles'))
            ->setParameter('roles', '%"ROLE_SUPER_ADMIN"%');

        return $qb->getQuery()->iterate();
    }