Skip to content

Commit

Permalink
Enable the role basics update and role permissions update for sub org…
Browse files Browse the repository at this point in the history
…anization roles
  • Loading branch information
ShanChathusanda93 committed Jan 26, 2025
1 parent 0f974ff commit fdff86e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/wet-mice-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wso2is/admin.roles.v2": patch
---

enable role basic update and role permission update in sub org roles
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const UpdatedRolePermissionDetails: FunctionComponent<RolePermissionDetai

const { t } = useTranslation();
const dispatch: Dispatch = useDispatch();
const { isSubOrganization } = useGetCurrentOrganizationType();

const [ isSubmitting, setIsSubmitting ] = useState<boolean>(false);
const [ selectedAPIResourceId, setSelectedAPIResourceId ] = useState<string>(undefined);
Expand All @@ -109,7 +108,7 @@ export const UpdatedRolePermissionDetails: FunctionComponent<RolePermissionDetai
const [ apiCallNextAfterValue, setAPICallNextAfterValue ] = useState<string>(null);

const shouldFetchAPIResources: boolean = role?.audience?.type?.
toUpperCase() === RoleAudienceTypes.ORGANIZATION && !isSubOrganization();
toUpperCase() === RoleAudienceTypes.ORGANIZATION;

const {
data: currentAPIResourcesListData,
Expand Down
4 changes: 2 additions & 2 deletions features/admin.roles.v2/components/edit-role/edit-role.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const EditRole: FunctionComponent<EditRoleProps> = (props: EditRoleProps)
render: () => (
<ResourceTab.Pane controlledSegmentation attached={ false }>
<BasicRoleDetails
isReadOnly={ isSubOrg || isAdminRole || isEveryoneRole || isReadOnly }
isReadOnly={ isAdminRole || isEveryoneRole || isReadOnly }
role={ roleObject }
onRoleUpdate={ onRoleUpdate }
tabIndex={ 0 }
Expand All @@ -135,7 +135,7 @@ export const EditRole: FunctionComponent<EditRoleProps> = (props: EditRoleProps)
render: () => (
<ResourceTab.Pane controlledSegmentation attached={ false }>
<UpdatedRolePermissionDetails
isReadOnly={ isSubOrg || isAdminRole || isReadOnly }
isReadOnly={ isAdminRole || isReadOnly }
role={ roleObject }
onRoleUpdate={ onRoleUpdate }
tabIndex={ 1 }
Expand Down

0 comments on commit fdff86e

Please sign in to comment.