codersforcauses / codersforcauses/teach-learn-grow
As an administrator I want to be able to change volunteer's permission
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Administrators should be able to changes volunteer's permissions. Admins should have access to an admin page where they can view all accounts in a table format. Here they can search for a specific account and click on a more info link (available for each row) which redirect to a new view in a new tab, which shows a user's information. They can then view and edit the details on the new tab including their permissions. This functionality should only be available to superusers.
**Tasks**
Frontend
- [ ] Admin route
- create a route that only coordinators and above can access (e.g. /admin)
- restrict access using the user's list of permissions (see backend tasks)
- this base admin page should contain links to other admin pages
- [ ] Roles & Permission admin page
- create an admin page and add a link to the base admin page created in the task above
- this page lists all users on the system (paginated) using a backend API endpoint
- clicking on a user opens up a modal that displays their details as well as the roles and permissions that they have
- roles and permissions fields are represented as pills that has an x button, when users click this button it removes the role or permission from the user
- roles field and permissions field should also have a + button that allows users to add a new role/permission to the user. the list of roles and permissions should be fetched from a backend API endpoint
Backend
- [ ] List user's permission endpoint
- GET request, given a user's email/id, return all of their unique permissions (combine both direct permissions and permissions granted through
- [ ] List all users endpoint
- GET request, return a list of all users including their details as well as all of their roles and permissions
- this endpoint should be paginated. ie given a page number, return x number of users.
- e.g. page size is 20. page no 1 = first 20 users, page no 2 = user #21 > user #41, etc
- designate permission to this endpoint (e.g. `read:users`) and restrict it to administrators
- [ ] Add permission endpoint
- POST request, given a user id and a permission name, add that permission to the user
- designate permission to this endpoint and restrict it to superusers (execs)
- [ ] Add role endpoint
- POST request, given a user id and a role name, add that role to the user
- designate permission to this endpoint and restrict it to superusers (execs)
- [ ] Remove permission endpoint
- DELETE request, given a user id and a permission name, remove that permission from the user
- designate permission to this endpoint and restrict it to superusers (execs)
- [ ] Remove role endpoint
- DELETE request, given a user id and a role name, remove that role from the user
- designate permission to this endpoint and restrict it to superusers (execs)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.