Exercise - Manage permissions
As highlighted earlier, you can add users with permissions to modify data through the admin site. Let's update the staffuser user we created in a prior unit to have permissions to modify dogs.
Set the user permissions
Return to the admin site in your browser.
Select Users.
Select staffuser to update our staffuser.
Ensure Staff status is selected.
Scroll down to User permissions.
Select the following permissions:
- dog_shelters | dog | Can add dog
- dog_shelters | dog | Can change dog
- dog_shelters | dog | Can view dog
Note
The page highlights that you can select multiple permissions by using Control or Command and selecting each item.
Select Choose.
Select SAVE.
Sign in as the staff user
Let's see the difference between a superuser and a staff user by signing in as a staff user.
Select LOG OUT in the upper-right corner.
Select Login again.
Sign in as staffuser by using the password you created earlier.
Note
If you forgot the password, you can sign in as your superuser and reset the password.
Notice that the admin page only allows access to Dogs.
Select Dogs.
Select the dog you created earlier.
Notice that you can modify the dog, but not delete it.
Summary
We've now configured a staff user with limited permissions in the admin site. You can use this capability to control access to sensitive data in your application.