Per-object permissions allow only specific users to access, modify, and delete data that they own. In this video, learn how to create and filter objects based on user-specific per-object permissions.
- [Instructor] Now that we have … per object permissions enabled … we need to assign permissions to … model whenever a user creates it. … When a user books a tour package, … a booking model instance is created. … It is logical that the user is the … only one that can modify their own booking. … So we're going to start by importing … the receiver decorator. … And then we're going to be importing the … post save signal. … And from guardian, we are going to be importing the shortcut … for assigning permission. … Now we scroll down to after the booking model definition … and we're going to be using the receiver … and we are going to be acting on the post save signal, … for the booking … and we call it set booking permissions. … And the user … is based on the email address of the booking. … And we're going to assign permission … for the API change booking permission. … We're going to assign it to the user … and that's the model level permission. … And now we're going to assign the … per object permission by specifying the instance as well. …
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.