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?",
|
path: "/:realm/authentication/:tab?",
|
||||||
component: lazy(() => import("../AuthenticationSection")),
|
component: lazy(() => import("../AuthenticationSection")),
|
||||||
breadcrumb: (t) => t("authentication"),
|
breadcrumb: (t) => t("authentication"),
|
||||||
access: "view-realm",
|
access: ["view-realm", "view-identity-providers", "view-clients"],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const toAuthentication = (
|
export const toAuthentication = (
|
||||||
|
|
|
@ -14,7 +14,7 @@ export const FlowRoute: RouteDef = {
|
||||||
path: "/:realm/authentication/:id/:usedBy/:builtIn?",
|
path: "/:realm/authentication/:id/:usedBy/:builtIn?",
|
||||||
component: lazy(() => import("../FlowDetails")),
|
component: lazy(() => import("../FlowDetails")),
|
||||||
breadcrumb: (t) => t("authentication:flowDetails"),
|
breadcrumb: (t) => t("authentication:flowDetails"),
|
||||||
access: "manage-authorization",
|
access: "view-authorization",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const toFlow = (params: FlowParams): LocationDescriptorObject => ({
|
export const toFlow = (params: FlowParams): LocationDescriptorObject => ({
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { toDashboard } from "../../dashboard/routes/Dashboard";
|
||||||
export default function NewRealmForm() {
|
export default function NewRealmForm() {
|
||||||
const { t } = useTranslation("realm");
|
const { t } = useTranslation("realm");
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { refresh } = useWhoAmI();
|
const { refresh, whoAmI } = useWhoAmI();
|
||||||
const { refresh: refreshRealms } = useRealms();
|
const { refresh: refreshRealms } = useRealms();
|
||||||
const adminClient = useAdminClient();
|
const adminClient = useAdminClient();
|
||||||
const { addAlert, addError } = useAlerts();
|
const { addAlert, addError } = useAlerts();
|
||||||
|
@ -59,7 +59,8 @@ export default function NewRealmForm() {
|
||||||
<FormAccess
|
<FormAccess
|
||||||
isHorizontal
|
isHorizontal
|
||||||
onSubmit={handleSubmit(save)}
|
onSubmit={handleSubmit(save)}
|
||||||
role="manage-realm"
|
role="view-realm"
|
||||||
|
isReadOnly={!whoAmI.canCreateRealm()}
|
||||||
>
|
>
|
||||||
<JsonFileUpload
|
<JsonFileUpload
|
||||||
id="kc-realm-filename"
|
id="kc-realm-filename"
|
||||||
|
|
|
@ -9,7 +9,7 @@ export const AddRealmRoute: RouteDef = {
|
||||||
path: "/:realm/add-realm",
|
path: "/:realm/add-realm",
|
||||||
component: lazy(() => import("../add/NewRealmForm")),
|
component: lazy(() => import("../add/NewRealmForm")),
|
||||||
breadcrumb: (t) => t("realm:createRealm"),
|
breadcrumb: (t) => t("realm:createRealm"),
|
||||||
access: "manage-realm",
|
access: "view-realm",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const toAddRealm = (
|
export const toAddRealm = (
|
||||||
|
|
|
@ -9,7 +9,7 @@ export const SessionsRoute: RouteDef = {
|
||||||
path: "/:realm/sessions",
|
path: "/:realm/sessions",
|
||||||
component: lazy(() => import("../SessionsSection")),
|
component: lazy(() => import("../SessionsSection")),
|
||||||
breadcrumb: (t) => t("sessions:title"),
|
breadcrumb: (t) => t("sessions:title"),
|
||||||
access: "view-realm",
|
access: ["view-realm", "view-clients", "view-users"],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const toSessions = (
|
export const toSessions = (
|
||||||
|
|
Loading…
Reference in a new issue