Lesson 8 / 9
Roles and permissions
Who may use the dashboard and what you may change.
Participants have no account. Accounts exist only for organisers and administrators.
| Account | Dashboard | Changing things in the dashboard | Django admin and Wagtail |
|---|---|---|---|
| Without staff status | no | no | no |
| Staff | yes | only with the matching permissions | what the permissions allow |
| Superuser | yes | yes | yes |
- The dashboard is only for accounts with staff status. Any other account that logs in sees No access: "You are signed in, but this page is not open to your account."
- Changing something also needs the matching permission. Someone who may not change a workshop does not see, for example, the Probe and Save buttons on Providers.
- The server's administrator creates the first account, with the command
study_superuser. You manage other accounts and their permissions in the Django admin, under Sturnus Accounts > Accounts. There the staff status is called Is Staff. - You cannot change your own permissions. Ask the server's administrator.
Accounts
You manage accounts in the Django admin: in the menu on the left, under
Sturnus Accounts, choose Accounts, or go to
/admin/sturnus_accounts/accountmodel/.
- Search finds an account by username or email address. In the picture
the search is for
sanne.devries, an organiser of the demo workshop. - The columns Is Active, Is Staff and Superuser status show at a glance what an account may do. Is Staff is the staff status: only then does the dashboard open.
- On the right, under Filter, you filter on the same three properties, for example all accounts with staff status.
- Add Account creates a new account: first the username, the email address and the password, then you set the permissions.
- Click a username to open the account.
Do not delete an account when someone may not log in for a while: untick Is Active instead. What is gone in the Django admin is really gone.
An account's permissions
The account of an organiser: staff status, but no superuser.
- Account Details: the username, the email address and the Password. The email address is needed for Forgot your password?. If the account has no password, as here, it says "No password set." and you set one with Set password.
- Permissions:
- Is Active: off means the account can no longer log in, without it being gone.
- Is Staff: the staff status. With this ticked, the dashboard opens.
- Superuser status: all permissions, without assigning them separately. Only give this to whoever runs the server.
- Further down the page is Roles: the groups the account belongs to. Each role grants its own permissions. Pick a role on the left under Available groups and move it with the arrow to Chosen groups. Below that are the account's profile and settings.
- Save with Save at the bottom of the page.
Only a superuser can change Is Staff, Superuser status and an account's roles. That way nobody can give themselves more permissions.