Add object level permission permissions to role page (ReadOnly) (#11568)
## Context This PR adds the display of object-level permissions. A following PR will add the ability to update those permissions. The PR contains the SettingsRoleObjectLevel page but it's not fully implemented yet (save won't trigger the corresponding mutation) <img width="616" alt="Screenshot 2025-04-14 at 18 02 40" src="https://github.com/user-attachments/assets/f8c58193-31f3-468a-a96d-f06a9f2e1423" />
This commit is contained in:
@ -0,0 +1,27 @@
|
||||
import { Navigate, useParams } from 'react-router-dom';
|
||||
|
||||
import { SettingsRolesQueryEffect } from '@/settings/roles/components/SettingsRolesQueryEffect';
|
||||
import { SettingsRolePermissionsObjectLevelObjectForm } from '@/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectForm';
|
||||
import { isDefined } from 'twenty-shared/utils';
|
||||
|
||||
export const SettingsRoleObjectLevel = () => {
|
||||
const { roleId, objectMetadataId } = useParams();
|
||||
|
||||
if (!isDefined(roleId)) {
|
||||
return <Navigate to="/settings/roles" />;
|
||||
}
|
||||
|
||||
if (!isDefined(objectMetadataId)) {
|
||||
return <Navigate to={`/settings/roles/${roleId}`} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingsRolesQueryEffect />
|
||||
<SettingsRolePermissionsObjectLevelObjectForm
|
||||
roleId={roleId}
|
||||
objectMetadataId={objectMetadataId}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user