Returns role details.

@param string $project_key Project key.
@param string $role_id     Role ID.

@return array|false
778697
public function getRoleDetails($project_key, $role_id)
	{
		return $this->api(
			self::REQUEST_GET,
			sprintf('/rest/api/2/project/%s/role/%s', $project_key, $role_id),
			array(),
			true
		);
	}
618082
public function addRoleByName($role_name)
    {
        $role = static::$app['db']->connection()
            ->table('roles')->where('name', '=', $role_name)->first();

        if (! $role)
            throw new \RuntimeException('No role with that name found.');

        if (is_array($role))
            return $this->addRoleById($role['id']);
        elseif (is_object($role))
            return $this->addRoleById($role->id);
        else
            throw new \UnexpectedValueException('Value returned not array or instance of BridgeRole.');
    }
1328699
public function getAction($roleId, $key)
    {
        $settingValue = $this->get('sulu.repository.role_setting')->findSettingValue($roleId, $key);

        return $this->handleView($this->view($settingValue));
    }
1048452
public function editUserRole($role_id = null)
    {
        $this->setUserRole($role_id);
        $this->setTitleEditUserRole();
        $this->setBreadcrumbEditUserRole();

        $this->setData('role', $this->data_role);
        $this->setData('permissions', $this->getPermissionsUserRole(true));

        $this->submitEditUserRole();
        $this->outputEditUserRole();
    }
342723
public function editRole($role_id)
    {

        // Get the role. We don't get the full one
        // as we need to mangle some of the data to
        // arrays for easier processing in the view
        $role = $this->getRole($role_id);

        $role_permissions = $role->permissions()->get()->pluck('title')->toArray();
        $role_affiliations = $role->affiliations();
        $role_groups = $role->groups()->get()->pluck('id')->toArray();
        $all_groups = $this->getAllGroups();
        $all_characters = $this->getAllCharacters();
        $all_corporations = $this->getAllCorporations();

        return view(
            'web::configuration.access.edit',
            compact(
                'role', 'role_permissions', 'role_groups', 'all_groups',
                'role_affiliations', 'all_characters', 'all_corporations'
            ));
    }
1024128
def project_roles(self, project):
        
        path = 'project/' + project + '/role'
        _rolesdict = self._get_json(path)
        rolesdict = {}

        for k, v in _rolesdict.items():
            tmp = {}
            tmp['id'] = v.split("/")[-1]
            tmp['url'] = v
            rolesdict[k] = tmp
        return rolesdict
1336118
public function getDefinitionRoleDimensionMembers( $roleRefsKey )
	{
		$roles = $this->getAllDefinitionRoles();

		if ( ! isset( $roles[ $roleRefsKey ] ) )
		{
			return array();
		}

		$taxonomy = $this->getTaxonomyForXSD( $roles[ $roleRefsKey ] );
		$role = $taxonomy->getDefinitionRoleRef( $roleRefsKey );

		return isset( $role['members'] )
			? $role['members']
			: array();

		/*
		$roleMembers = array();
		if ( ! isset( $this->definitionRoleRefs[ $roleRefsKey ] ) ) return array();

		$role = $this->definitionRoleRefs[ $roleRefsKey ];

		if ( isset( $role['members'] ) && count( $role['members'] ) )
		{
			$roleMembers = $role['members'];
		}
		else if ( isset( $role['hypercubes'] ) && count( $role['hypercubes'] ) )
		{
			foreach ( $role['hypercubes'] as $hypercubeLabel => $hypercube )
			{
				foreach ( $hypercube['dimensions'] as $dimLabel => $dimension )
				{
					if ( ! isset( $dimension['targetRole'] ) ) continue;
					$taxonomy = $this->getTaxonomyForNamespace( $dimension['member_namespace'] );
					if ( ! $taxonomy )
					{
						$this->log()->dimension_validation( "dimensions", "A taxonomy cannot be found corresponding to a namespace", array(
							'dimension' => "'$dimLabel'",
							'namespace' => $dimension['member_namespace'] ? "'{$dimension['member_namespace']}'" : "Undefined",
						) );
						continue;
					}
					$roleMembers += $taxonomy->getDefinitionRoleDimensionMembers( $dimension['targetRole'] );
				}
			}

			return $roleMembers;
		}
		else if ( strpos( $role['href'], $this->getTaxonomyXSD() ) === false )
		{
			$roleMembers = $this->getTaxonomyForXSD( $role['href'] )->getDefinitionRoleDimensionMembers( $roleRefsKey );
			return $roleMembers;
		}

		foreach ( $roleMembers as $memberKey => $member )
		{
			if ( ! isset( $roleMembers[ $memberKey ]['roles'] ) )
			{
				$roleMembers[ $memberKey ]['roles'] = $roleRefsKey;
			}
			else
			{
				// Add unique roleRefsKey
				if ( in_array( $roleRefsKey, $roleMembers[ $memberKey ]['roles'] ) ) continue;
				$roleMembers[ $memberKey ]['roles'][] = $roleRefsKey;
			}
		}

		return $roleMembers;

		$result = array();

		foreach ( $roleMembers as $memberKey => $member )
		{
			if ( ! isset( $result[ $memberKey ] ) )
			{
				$result[ $memberKey ] = array( 'href' => $member, 'roles' => array( $roleRefsKey ) );
				continue;
			}

			// Add unique roleRefsKey
			if ( in_array( $roleRefsKey, $result[ $memberKey ]['roles'] ) ) continue;
			$result[ $memberKey ]['roles'][] = $roleRefsKey;
		}

		return $result;
		*/
	}
687427
public function loadPolicies($roleId, Request $request)
    {
        $loadedRole = $this->roleService->loadRole($roleId);

        return new Values\PolicyList($loadedRole->getPolicies(), $request->getPathInfo());
    }
738444
public function getRolesIdList() {

		$roles		= $this->roleMappingList;
		$rolesList	= array();

		foreach ( $roles as $role ) {

			array_push( $rolesList, $role->roleId );
		}

		return $rolesList;
	}
949112
public function getPresentationRoleHypercubes( $roleKey )
	{
		/**
		 * @var array $refs
		 */
		$refs = $this->context->presentationRoleRefs;

		if ( ! isset( $refs[ $roleKey ] ) ) return array();
		return isset( $refs[ $roleKey ]['hypercubes'] )
			? $refs[ $roleKey ]['hypercubes']
			: array();
	}
1089488
public function members($project_id, $parameters = [])
    {
        if (!is_array($parameters)) {
            @trigger_error("Deprecated: String parameter of the members() function is deprecated.", E_USER_NOTICE);
            $username_query = $parameters;
            $parameters = array();
            if (!empty($username_query)) {
                $parameters['query'] = $username_query;
            }
        }

        $resolver = $this->createOptionsResolver();

        $resolver->setDefined('query')
            ->setAllowedTypes('query', 'string')
        ;

        return $this->get($this->getProjectPath($project_id, 'members'), $resolver->resolve($parameters));
    }
1053375
private function getLinkRoleDescription( $role, $roleType, $roleTitle )
	{
		$href = parse_url( $role['href'] );
		$basename = basename( $href['path'] );
		$roleTypes = $this->getRoleTypes( $role['href'] );
		if ( $roleTypes === false )
		{
			$this->log()->warning( "A role type cannot be found for '$basename'" );
			return false;
		}

		if ( ! isset( $roleTypes[ $roleType ] ) )
		{
			$this->log()->warning( "The role type corresponding to href '$basename' does not include one used on a $roleTitle.'" );
			return false;
		}

		$linkRoleType = $roleTypes[ $roleType ];
		if ( ! isset( $linkRoleType[ $role['roleUri'] ] ) )
		{
			$fragment = isset( $href['fragment'] ) ? $href['fragment'] : "";
			$this->log()->warning( "The $roleTitle of the role type corresponding to href '$basename' does not include an Id with fragment '$fragment'." );
			return false;
		}

		$link = $linkRoleType[ $role['roleUri'] ];
		return isset( $link['definition'] ) ? trim( $link['definition'] ) : $role['roleUri'];
	}
1019067
public function getDefinitionRoleLocator( $roleRefsKey, $locator )
	{
		$locators = $this->getDefinitionRoleLocators( $roleRefsKey );
		return $locators && isset( $locators[ $locator ] ) ? $locators[ $locator ] : false;
	}
898006
public function deleteRole($projectId, $roleId)
    {
        return $this->apiClient->callEndpoint(
            sprintf('%s/%s/role/%s', self::ENDPOINT, $projectId, $roleId),
            array(),
            null,
            HttpMethod::REQUEST_DELETE
        );
    }
60728
private function getSpecifiedProjectRole(array $roles)
    {
        foreach ($roles as $role) {
            if (strpos($role, ':') === false) {
                return $this->validateProjectRole($role);
            }
        }

        return null;
    }
950587
public function getDefinitionRoleLocators( $roleRefsKey )
	{
		if ( ! isset( $this->definitionRoleRefs[ $roleRefsKey ] ) ) return array();
		$role = $this->definitionRoleRefs[ $roleRefsKey ];
		if ( strpos( $role['href'], $this->getTaxonomyXSD() ) === false )
		{
			return $this->getTaxonomyForXSD( $role['href'] )->getDefinitionRoleLocators( $roleRefsKey );
		}
		return isset( $role['locators'] ) ? $role['locators'] : array();
	}
501195
public function showNotes($project_id, $mr_id)
    {
        return $this->get($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id).'/notes'));
    }