Permissions refactor and implementation on Book Manager (chapter proccessed)
Implementing Permmisions
- as Defined in this sheet here
wrap all components with permission gate, with appropriate scope
-
Upload chapters modal (Bulk upload) -
Team modal -
Settings modal (See readme) -
Metadata modal -
Add part -
Order by drag and drop (when manual ordering is ON)
(This has a fix with issue #1253 (closed) ) -
TOC page -
Publish TOC -
Submit -
Reload preview -
Publish components -
Download (Not for the first deployment)
-
Archive -
Move to and Repeat
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