1
import { PageSection } from "@patternfly/react-core";
3
import { adminClient } from "../admin-client";
4
import { RolesList } from "../components/roles-list/RolesList";
5
import { ViewHeader } from "../components/view-header/ViewHeader";
6
import { useAccess } from "../context/access/Access";
7
import { useRealm } from "../context/realm-context/RealmContext";
8
import helpUrls from "../help-urls";
9
import { toAddRole } from "./routes/AddRole";
10
import { toRealmRole } from "./routes/RealmRole";
12
export default function RealmRolesSection() {
13
const { realm } = useRealm();
14
const { hasAccess } = useAccess();
15
const isManager = hasAccess("manage-realm");
17
const loader = (first?: number, max?: number, search?: string) => {
18
const params: { [name: string]: string | number } = {
23
const searchParam = search || "";
26
params.search = searchParam;
29
return adminClient.roles.find(params);
37
helpUrl={helpUrls.realmRolesUrl}
39
<PageSection variant="light" padding={{ default: "noPadding" }}>
42
toCreate={toAddRole({ realm })}
44
toRealmRole({ realm, id: roleId, tab: "details" })
46
isReadOnly={!isManager}