parent
b0e7958906
commit
8eb631b9d9
3 changed files with 19 additions and 13 deletions
|
@ -198,7 +198,6 @@ export default function ClientDetails() {
|
||||||
const hasManageClients = hasAccess("manage-clients");
|
const hasManageClients = hasAccess("manage-clients");
|
||||||
const hasViewClients = hasAccess("view-clients");
|
const hasViewClients = hasAccess("view-clients");
|
||||||
const hasViewUsers = hasAccess("view-users");
|
const hasViewUsers = hasAccess("view-users");
|
||||||
const hasQueryUsers = hasAccess("query-users");
|
|
||||||
const permissionsEnabled =
|
const permissionsEnabled =
|
||||||
isFeatureEnabled(Feature.AdminFineGrainedAuthz) && hasManageAuthorization;
|
isFeatureEnabled(Feature.AdminFineGrainedAuthz) && hasManageAuthorization;
|
||||||
|
|
||||||
|
@ -490,7 +489,7 @@ export default function ClientDetails() {
|
||||||
isReadOnly={!(hasManageClients || client.access?.configure)}
|
isReadOnly={!(hasManageClients || client.access?.configure)}
|
||||||
/>
|
/>
|
||||||
</Tab>
|
</Tab>
|
||||||
{!isRealmClient(client) && !client.bearerOnly && hasQueryUsers && (
|
{!isRealmClient(client) && !client.bearerOnly && (
|
||||||
<Tab
|
<Tab
|
||||||
id="clientScopes"
|
id="clientScopes"
|
||||||
data-testid="clientScopesTab"
|
data-testid="clientScopesTab"
|
||||||
|
|
|
@ -133,6 +133,7 @@ export const ClientScopes = ({
|
||||||
|
|
||||||
const { hasAccess } = useAccess();
|
const { hasAccess } = useAccess();
|
||||||
const isManager = hasAccess("manage-clients") || fineGrainedAccess;
|
const isManager = hasAccess("manage-clients") || fineGrainedAccess;
|
||||||
|
const isViewer = hasAccess("view-clients") || fineGrainedAccess;
|
||||||
|
|
||||||
const loader = async (first?: number, max?: number, search?: string) => {
|
const loader = async (first?: number, max?: number, search?: string) => {
|
||||||
const defaultClientScopes =
|
const defaultClientScopes =
|
||||||
|
@ -177,7 +178,7 @@ export const ClientScopes = ({
|
||||||
const firstNum = Number(first);
|
const firstNum = Number(first);
|
||||||
const page = localeSort(rows.filter(filter), mapByKey("name"));
|
const page = localeSort(rows.filter(filter), mapByKey("name"));
|
||||||
|
|
||||||
if (isManager) {
|
if (isViewer) {
|
||||||
page.unshift({
|
page.unshift({
|
||||||
id: DEDICATED_ROW,
|
id: DEDICATED_ROW,
|
||||||
name: t("dedicatedScopeName", { clientName }),
|
name: t("dedicatedScopeName", { clientName }),
|
||||||
|
|
|
@ -35,6 +35,7 @@ import { useServerInfo } from "../../context/server-info/ServerInfoProvider";
|
||||||
import { prettyPrintJSON } from "../../util";
|
import { prettyPrintJSON } from "../../util";
|
||||||
import { useFetch } from "../../utils/useFetch";
|
import { useFetch } from "../../utils/useFetch";
|
||||||
import { GeneratedCodeTab } from "./GeneratedCodeTab";
|
import { GeneratedCodeTab } from "./GeneratedCodeTab";
|
||||||
|
import { useAccess } from "../../context/access/Access";
|
||||||
|
|
||||||
import "./evaluate.css";
|
import "./evaluate.css";
|
||||||
|
|
||||||
|
@ -144,6 +145,9 @@ export const EvaluateScopes = ({ clientId, protocol }: EvaluateScopesProps) => {
|
||||||
|
|
||||||
const form = useForm();
|
const form = useForm();
|
||||||
|
|
||||||
|
const { hasAccess } = useAccess();
|
||||||
|
const hasViewUsers = hasAccess("view-users");
|
||||||
|
|
||||||
useFetch(
|
useFetch(
|
||||||
() => adminClient.clients.listOptionalClientScopes({ id: clientId }),
|
() => adminClient.clients.listOptionalClientScopes({ id: clientId }),
|
||||||
(optionalClientScopes) => setSelectableScopes(optionalClientScopes),
|
(optionalClientScopes) => setSelectableScopes(optionalClientScopes),
|
||||||
|
@ -273,16 +277,18 @@ export const EvaluateScopes = ({ clientId, protocol }: EvaluateScopesProps) => {
|
||||||
</SplitItem>
|
</SplitItem>
|
||||||
</Split>
|
</Split>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
<FormProvider {...form}>
|
{hasViewUsers && (
|
||||||
<UserSelect
|
<FormProvider {...form}>
|
||||||
name="user"
|
<UserSelect
|
||||||
label="users"
|
name="user"
|
||||||
helpText={t("clients-help:user")}
|
label="users"
|
||||||
defaultValue=""
|
helpText={t("clients-help:user")}
|
||||||
variant={SelectVariant.typeahead}
|
defaultValue=""
|
||||||
isRequired
|
variant={SelectVariant.typeahead}
|
||||||
/>
|
isRequired
|
||||||
</FormProvider>
|
/>
|
||||||
|
</FormProvider>
|
||||||
|
)}
|
||||||
</Form>
|
</Form>
|
||||||
</PageSection>
|
</PageSection>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue