@param $role_id

@return \Illuminate\View\View
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'
            ));
    }
557751
public function index()
    {
        $roles = $this->roleRepository->createModel()->all();
        $userRoleIds = Sentinel::getUser()->roles()->pluck('id');

        return view('Centaur::roles.index')
            ->with('userRoleIds', $userRoleIds)
            ->with('roles', $roles);
    }
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
		);
	}
915975
public function hasRoleById(int $roleId): bool
    {
        if (isset($this->roles[$roleId])) {
            return true;
        }

        return false;
    }
622884
public function view(string $id = null)
    {
        $role = $this->Roles->get($id, [
            'contain' => ['Groups']
        ]);

        $roleCaps = $this->Roles->Capabilities->find('list')->where(['role_id' => $id])->toArray();

        $capabilities = $this->formatCapabilities(Utils::getAllCapabilities());

        $this->set('capabilities', $capabilities);
        $this->set('roleCaps', $roleCaps);
        $this->set('role', $role);
        $this->set('_serialize', ['role']);
    }
687427
public function loadPolicies($roleId, Request $request)
    {
        $loadedRole = $this->roleService->loadRole($roleId);

        return new Values\PolicyList($loadedRole->getPolicies(), $request->getPathInfo());
    }
1105211
public function loadRoleDraftByRoleId($roleId)
    {
        $data = $this->roleGateway->loadRoleDraftByRoleId($roleId);

        if (empty($data)) {
            throw new RoleNotFound($roleId, Role::STATUS_DRAFT);
        }

        $role = $this->mapper->mapRole($data);
        foreach ($role->policies as $policy) {
            $this->limitationConverter->toSPI($policy);
        }

        return $role;
    }
1196414
private function _expandRole(&$roleList, $roleName, $depth = 0)
    {
        $role = $roleList[$roleName];

        if (isset($role['marked']) && $role['marked']) {
            return;
        }

        // possible circular reference!
        if ($depth > 5) {
            throw new \Exception("Possible circular reference detected while expanding role '{$roleName}'");
        }

        if (!empty($role['grl_parents'])) {
            $parents = $this->translateToRoleNames($role['grl_parents']);

            foreach ($parents as $parent) {
                $this->_expandRole($roleList, $parent, $depth + 1);
            }
        } else {
            $parents = array();
        }

        $this->_acl->addRole(new \Zend_Acl_Role($role['grl_name']), $parents);

        $privileges = array_filter(array_map('trim', explode(",", $role['grl_privileges'])));
        if ($privileges) {
            $this->_acl->addPrivilege($role['grl_name'], $privileges);
        }

        $roleList[$roleName]['marked'] = true;
    }
1222232
public function removeGroup($role_id, $group_id)
    {

        $this->removeGroupFromRole($group_id, $role_id);

        return redirect()->back()
            ->with('success', trans('web::seat.user_removed'));
    }
1104192
public function findSettingValue($roleId, $key)
    {
        $queryBuilder = $this->createQueryBuilder('s')
            ->select('s.value')
            ->join('s.role', 'r')
            ->where('r.id = :roleId')
            ->andWhere('s.key = :key')
            ->setParameters(['roleId' => $roleId, 'key' => $key]);

        try {
            return json_decode($queryBuilder->getQuery()->getSingleScalarResult(), true);
        } catch (NoResultException $e) {
            return;
        }
    }
78737
public function removeRole($roleId, $pageId = 0)
    {
        $this->roles()
            ->wherePivot(self::PIVOT_ATTR_ROLE_ID, '=', $roleId)
            ->wherePivot(self::PIVOT_ATTR_PAGE_ID, '=', $pageId)
            ->detach();

        return $this;
    }
247118
public function hasRole($roleId, $pageId = 0)
    {
        return $this->roles()
            ->wherePivot(self::PIVOT_ATTR_PAGE_ID, '=', $pageId)
            ->wherePivot(self::PIVOT_ATTR_ROLE_ID, '=', $roleId)
            ->exists();
    }
1349856
def role_show(self, role_id, **kwargs):
        ""
        api_path = "/api/v2/roles/{role_id}"
        api_path = api_path.format(role_id=role_id)
        return self.call(api_path, **kwargs)
768812
public function deleteRoleDraft($roleId)
    {
        $this->roleService->deleteRoleDraft(
            $this->roleService->loadRoleDraft($roleId)
        );

        return new Values\NoContent();
    }
527151
public function getRoleByKey ($roleKey)
    {
        return array_key_exists($roleKey, $this->roleCollection)
            ? $this->roleCollection[$roleKey]
            : null;
    }
173138
public function update(RoleRequest $request, $id)
    {
        $input = $request->except('permissions');

        $record = $this->model->findOrFail($id);

        $record->syncPermissions($request->permissions);

        $record->update($input);

        $this->notify([
            'type' => 'success',
            'title' => 'Successful update!',
            'description' => 'This role is updated successfully.',
        ]);

        return redirect()->back();
    }
105121
public function loadRoleAssignmentsByRoleId($roleId)
    {
        try {
            return $this->innerGateway->loadRoleAssignmentsByRoleId($roleId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }