[permissions] Add permission gates on workspaceMember (#10447)

- Adding permission gates on workspaceMember to only allow user with
admin permissions OR users attempting to update or delete themself to
perform write operations on workspaceMember object
- Reverting some changes to treat workflow objects as regular metadata
objects (any user can interact with them)
- (fix) Block updates on soft deleted records
This commit is contained in:
Marie
2025-02-24 16:59:28 +01:00
committed by GitHub
parent 970aa4c5a1
commit e4f06a7c97
20 changed files with 655 additions and 37 deletions

View File

@ -1,5 +1,4 @@
export * from './fieldMetadata';
export * from './image';
export * from './permissions';
export * from './strings';
export * from './validation';

View File

@ -1 +0,0 @@
export * from './isObjectRecordUnderObjectRecordsPermissions';

View File

@ -1,16 +0,0 @@
import { STANDARD_OBJECT_RECORDS_UNDER_OBJECT_RECORDS_PERMISSIONS } from 'src/constants';
export const isObjectRecordUnderObjectRecordsPermissions = ({
isCustom,
nameSingular,
}: {
isCustom: boolean;
nameSingular: string;
}) => {
return (
isCustom ||
STANDARD_OBJECT_RECORDS_UNDER_OBJECT_RECORDS_PERMISSIONS.includes(
nameSingular,
)
);
};