mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Simplified has_perm() example in topics/auth/customizing.txt.
This commit is contained in:
committed by
Tim Graham
parent
4ff389dcdc
commit
0a6ed6b1d9
@@ -202,10 +202,7 @@ fairly simply::
|
|||||||
class SettingsBackend(object):
|
class SettingsBackend(object):
|
||||||
...
|
...
|
||||||
def has_perm(self, user_obj, perm, obj=None):
|
def has_perm(self, user_obj, perm, obj=None):
|
||||||
if user_obj.username == settings.ADMIN_LOGIN:
|
return user_obj.username == settings.ADMIN_LOGIN
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
This gives full permissions to the user granted access in the above example.
|
This gives full permissions to the user granted access in the above example.
|
||||||
Notice that in addition to the same arguments given to the associated
|
Notice that in addition to the same arguments given to the associated
|
||||||
|
|||||||
Reference in New Issue
Block a user