Now that you've implemented access control and group permissions, check your work. In this video, learn how to write a unit test that ensures that group permissions are working as expected.
- [Instructor] Let's write another access control test … to ensure group permissions are working properly. … Before we get started, Let's take a look … at this sign permission, shortcut function we used. … As you can see the function imports the group model … and then imports the assigned permission function … from django guardian. … And then for every group and the permissions, … we are getting the group model instance. … And then assigning each permission using … the django guardian shortcut. … Next, we have a function that checks whether a given group … has permission to access a given object. … We fetch the group model instance. … And then we use the get objects … for group django guardian shortcut … to check whether out of the set of all objects … that this group has permission to … whether the given object is in that set. … And lastly, we have the user has group perm function. … Which will check whether a user has permission to access … through their group permissions, a specific object. …
Skill Level Advanced
Building a Paid Membership Site with Djangowith Nick Walter1h 15m Intermediate
OWASP Top 10: #7 XSS and #8 Insecure Deserializationwith Caroline Wong26m 31s Intermediate
Building RESTful Web APIs with Djangowith Rudolf Olah1h 9m Intermediate
1. Permissions, Access Controls, Activity Logs
2. Throttling a Flood of Requests
3. Protecting Data and Data Privacy
4. 2FA: Two-Factor Authentication
5. CSRF: Cross-Site Request Forgery Protection
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.