Permissions refactor and implementation on DASHBOARD
Implementing Permissions
- as Defined in this sheet here
wrap all components with permission gate, with apropriate scope
-
View Books and collections tab (dashboard) -
Create book -
Create collection - Publish Books (Not for the first deployment)
- Download Books (Not for the first deployment)
- Archive Books (Not for the first deployment)
- Delete Books (Not for the first deployment) (@DioneMentis missing in the sheet)
-
View Organizations tab -
Create New organization -
Delete organization -
View Organization settings tab -
Edit organization fields
-
View Users tab -
Accept/ reject users to the Org in Modal -
Accept/ reject users to the bulk actions -
Disable users -
Edit user data -
Edit role SYS admin (same rule modal and bulk actions) -
Edit role PDF2XML vendor (same rule modal and bulk actions) -
Edit role Org admin (same rule modal and bulk actions) -
Edit role Editor (same rule modal and bulk actions) - Edit role Author (same rule modal and bulk actions) (Not for the first deployment)
- Edit role Previewer (same rule modal and bulk actions) (Not for the first deployment)
-
Invite org admin
-
Organization access modal
-
Books Templates
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