Fix bugs when admin has limited roles. (#2098)
This commit is contained in:
parent
10b53617a0
commit
b892c49436
5 changed files with 7 additions and 6 deletions
|
@ -9,7 +9,7 @@ export const AuthenticationRoute: RouteDef = {
|
|||
path: "/:realm/authentication/:tab?",
|
||||
component: lazy(() => import("../AuthenticationSection")),
|
||||
breadcrumb: (t) => t("authentication"),
|
||||
access: "view-realm",
|
||||
access: ["view-realm", "view-identity-providers", "view-clients"],
|
||||
};
|
||||
|
||||
export const toAuthentication = (
|
||||
|
|
|
@ -14,7 +14,7 @@ export const FlowRoute: RouteDef = {
|
|||
path: "/:realm/authentication/:id/:usedBy/:builtIn?",
|
||||
component: lazy(() => import("../FlowDetails")),
|
||||
breadcrumb: (t) => t("authentication:flowDetails"),
|
||||
access: "manage-authorization",
|
||||
access: "view-authorization",
|
||||
};
|
||||
|
||||
export const toFlow = (params: FlowParams): LocationDescriptorObject => ({
|
||||
|
|
|
@ -24,7 +24,7 @@ import { toDashboard } from "../../dashboard/routes/Dashboard";
|
|||
export default function NewRealmForm() {
|
||||
const { t } = useTranslation("realm");
|
||||
const history = useHistory();
|
||||
const { refresh } = useWhoAmI();
|
||||
const { refresh, whoAmI } = useWhoAmI();
|
||||
const { refresh: refreshRealms } = useRealms();
|
||||
const adminClient = useAdminClient();
|
||||
const { addAlert, addError } = useAlerts();
|
||||
|
@ -59,7 +59,8 @@ export default function NewRealmForm() {
|
|||
<FormAccess
|
||||
isHorizontal
|
||||
onSubmit={handleSubmit(save)}
|
||||
role="manage-realm"
|
||||
role="view-realm"
|
||||
isReadOnly={!whoAmI.canCreateRealm()}
|
||||
>
|
||||
<JsonFileUpload
|
||||
id="kc-realm-filename"
|
||||
|
|
|
@ -9,7 +9,7 @@ export const AddRealmRoute: RouteDef = {
|
|||
path: "/:realm/add-realm",
|
||||
component: lazy(() => import("../add/NewRealmForm")),
|
||||
breadcrumb: (t) => t("realm:createRealm"),
|
||||
access: "manage-realm",
|
||||
access: "view-realm",
|
||||
};
|
||||
|
||||
export const toAddRealm = (
|
||||
|
|
|
@ -9,7 +9,7 @@ export const SessionsRoute: RouteDef = {
|
|||
path: "/:realm/sessions",
|
||||
component: lazy(() => import("../SessionsSection")),
|
||||
breadcrumb: (t) => t("sessions:title"),
|
||||
access: "view-realm",
|
||||
access: ["view-realm", "view-clients", "view-users"],
|
||||
};
|
||||
|
||||
export const toSessions = (
|
||||
|
|
Loading…
Reference in a new issue