Initial version of the group permissions tab (#2519)
This commit is contained in:
parent
4349f19e24
commit
ebf56dacc0
3 changed files with 15 additions and 1 deletions
|
@ -91,6 +91,8 @@
|
||||||
"permissionsListIntro": "Edit the permission list by clicking the scope-name. It then redirects to the permission details page of the client named <1>{{realm}}</1>",
|
"permissionsListIntro": "Edit the permission list by clicking the scope-name. It then redirects to the permission details page of the client named <1>{{realm}}</1>",
|
||||||
"usersPermissionsHint": "Fine grained permissions for managing all users in realm. You can define different policies for who is allowed to manage users in the realm.",
|
"usersPermissionsHint": "Fine grained permissions for managing all users in realm. You can define different policies for who is allowed to manage users in the realm.",
|
||||||
"clientsPermissionsHint": "Fine grained permissions for administrators that want to manage this client or apply roles defined by this client.",
|
"clientsPermissionsHint": "Fine grained permissions for administrators that want to manage this client or apply roles defined by this client.",
|
||||||
|
"groupsPermissionsHint":
|
||||||
|
"Determines if fine grained permissions are enabled for managing this role. Disabling will delete all current permissions that have been set up.",
|
||||||
"permissionsScopeName": "Scope-name",
|
"permissionsScopeName": "Scope-name",
|
||||||
"permissionsEnabled": "Permissions enabled",
|
"permissionsEnabled": "Permissions enabled",
|
||||||
"permissionsDisable": "Disable permissions?",
|
"permissionsDisable": "Disable permissions?",
|
||||||
|
|
|
@ -31,7 +31,7 @@ import { useConfirmDialog } from "../confirm-dialog/ConfirmDialog";
|
||||||
|
|
||||||
import "./permissions-tab.css";
|
import "./permissions-tab.css";
|
||||||
|
|
||||||
type PermissionScreenType = "clients" | "users";
|
type PermissionScreenType = "clients" | "users" | "groups";
|
||||||
|
|
||||||
type PermissionsTabProps = {
|
type PermissionsTabProps = {
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -59,6 +59,8 @@ export const PermissionsTab = ({ id, type }: PermissionsTabProps) => {
|
||||||
realm,
|
realm,
|
||||||
enabled,
|
enabled,
|
||||||
});
|
});
|
||||||
|
case "groups":
|
||||||
|
return adminClient.groups.updatePermission({ id: id! }, { enabled });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -77,6 +79,8 @@ export const PermissionsTab = ({ id, type }: PermissionsTabProps) => {
|
||||||
return adminClient.realms.getUsersManagementPermissions({
|
return adminClient.realms.getUsersManagementPermissions({
|
||||||
realm,
|
realm,
|
||||||
});
|
});
|
||||||
|
case "groups":
|
||||||
|
return adminClient.groups.listPermissions({ id: id! });
|
||||||
}
|
}
|
||||||
})(),
|
})(),
|
||||||
]),
|
]),
|
||||||
|
|
|
@ -27,6 +27,7 @@ import { toGroups } from "./routes/Groups";
|
||||||
import { toGroupsSearch } from "./routes/GroupsSearch";
|
import { toGroupsSearch } from "./routes/GroupsSearch";
|
||||||
import { GroupRoleMapping } from "./GroupRoleMapping";
|
import { GroupRoleMapping } from "./GroupRoleMapping";
|
||||||
import helpUrls from "../help-urls";
|
import helpUrls from "../help-urls";
|
||||||
|
import { PermissionsTab } from "../components/permission-tab/PermissionTab";
|
||||||
|
|
||||||
import "./GroupsSection.css";
|
import "./GroupsSection.css";
|
||||||
|
|
||||||
|
@ -176,6 +177,13 @@ export default function GroupsSection() {
|
||||||
>
|
>
|
||||||
<GroupRoleMapping id={id!} name={currentGroup()?.name!} />
|
<GroupRoleMapping id={id!} name={currentGroup()?.name!} />
|
||||||
</Tab>
|
</Tab>
|
||||||
|
<Tab
|
||||||
|
eventKey={4}
|
||||||
|
data-testid="permissionsTab"
|
||||||
|
title={<TabTitleText>{t("common:permissions")}</TabTitleText>}
|
||||||
|
>
|
||||||
|
<PermissionsTab id={id} type="groups" />
|
||||||
|
</Tab>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
)}
|
)}
|
||||||
{subGroups.length === 0 && <GroupTable />}
|
{subGroups.length === 0 && <GroupTable />}
|
||||||
|
|
Loading…
Reference in a new issue