Permissions refactor and implementation on Collection Manager
Implementing Permissions
- as Defined in this sheet here
wrap all components with permission gate, with appropriate scope
-
Settings modal (wrap the form and save button) -
Metadata modal (wrap the form and save button) -
Metadata modal Granthub (sysadmins only) -
Submit whole books -
Reload preview on whole books -
Publish whole books -
Move books into groups -
Order groups by drag and drop (when manual ordering is ON) -
View Collection TOC page -
Publish TOC
2. Test all the above UIs for all roles to have the correct access rights
3. Remove redundant code for permissions in the files where work is done
Note:
all elements mentioned above should be wrapped similar to the below example, where parameter scopes
should have the key-word to check if the user that is logged in has permission
<PermissionsGate scopes={['view-or-edit-component-name']}>
<ComponentToBeChecked />
</PermissionsGate>
Testing Permissions
Create users with these roles:
- System Admin
- PDF to XML Vendor
Users in Organization no. 1 (can be any title)
- Organization admin
- Editor in organization not assigned to any book
- Editor in organization and assign to book (ex Book no.1 (Word workflow chapter processed) - created in Organization no. 1)
- Editor in organization and assign to one book component
Users in Organization no. 2 (can be any title)
- Organization admin for this organization
- Editor in organization not assigned to any book
- Editor in organization and assign to book
After created 9 users with above roles , log in as any of them to test if you have correct permissions on the app