diff --git a/.changeset/serious-turkeys-serve.md b/.changeset/serious-turkeys-serve.md new file mode 100644 index 00000000000..0abf0ac7e53 --- /dev/null +++ b/.changeset/serious-turkeys-serve.md @@ -0,0 +1,5 @@ +--- +"@wso2is/admin.console-settings.v1": patch +--- + +Only show api resources for enabled features under console role permissions diff --git a/features/admin.console-settings.v1/components/console-roles/create-console-role-wizard/create-console-role-wizard-permissions-form.tsx b/features/admin.console-settings.v1/components/console-roles/create-console-role-wizard/create-console-role-wizard-permissions-form.tsx index 156c1f1f799..568d4ded8e5 100644 --- a/features/admin.console-settings.v1/components/console-roles/create-console-role-wizard/create-console-role-wizard-permissions-form.tsx +++ b/features/admin.console-settings.v1/components/console-roles/create-console-role-wizard/create-console-role-wizard-permissions-form.tsx @@ -30,6 +30,7 @@ import Checkbox from "@oxygen-ui/react/Checkbox"; import Paper from "@oxygen-ui/react/Paper"; import Typography from "@oxygen-ui/react/Typography"; import { ChevronDownIcon } from "@oxygen-ui/react-icons"; +import { AppState, FeatureConfigInterface } from "@wso2is/admin.core.v1"; import { CreateRolePermissionInterface } from "@wso2is/admin.roles.v2/models/roles"; import { IdentifiableComponentInterface } from "@wso2is/core/models"; import cloneDeep from "lodash-es/cloneDeep"; @@ -46,6 +47,7 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; +import { useSelector } from "react-redux"; import useGetAPIResourceCollections from "../../../api/use-get-api-resource-collections"; import { ConsoleRolesOnboardingConstants } from "../../../constants/console-roles-onboarding-constants"; import { @@ -114,6 +116,8 @@ const CreateConsoleRoleWizardPermissionsForm: FunctionComponent state.config.ui.features); + const [ expandedAccordions, setExpandedAccordions ] = useState([]); const [ selectedPermissions, setSelectedPermissions ] = useState(initialValues || { organization: {}, @@ -155,14 +159,14 @@ const CreateConsoleRoleWizardPermissionsForm: FunctionComponent - !filteringAPIResourceCollectionNames.includes(item?.name) + !filteringAPIResourceCollectionNames.includes(item?.name) && + featureConfig?.[item?.name]?.enabled ); return clonedTenantAPIResourceCollections;