Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

staff user is not restricting permission in django

class UserAdmin(BaseUserAdmin):
    ...
    def has_add_permission(self, request, obj=None):
        return request.user.is_superuser

    def has_delete_permission(self, request, obj=None):
        return request.user.is_superuser
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #staff #user #restricting #permission #django
ADD COMMENT
Topic
Name
4+2 =