Edit restricted may only create new references

This commit is contained in:
ShootingStar91
2024-07-16 11:58:47 +03:00
parent 1aa283d2a5
commit e8cab09ff7
+1 -2
View File
@@ -70,9 +70,8 @@ export const referencePage = (
idFieldName="rid"
createTitle={(ref: ReferenceDetailsType) => `${ref.title_primary}`}
getEditRights={(user: UserState) => {
// TODO check if these are right. Can all groups (except readonly) delete references?
if ([Role.Admin, Role.EditUnrestricted].includes(user.role)) return fullRights
if (user.role === Role.ReadOnly) return limitedRights
if (user.role === Role.EditRestricted) return { new: true }
return noRights
}}
/>