From 0a6ed6b1d9dadd0916e887ff9026cf206be36a5c Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Fri, 23 Sep 2016 22:28:32 +0300 Subject: [PATCH] Simplified has_perm() example in topics/auth/customizing.txt. --- docs/topics/auth/customizing.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt index 085f74fcde..068671c259 100644 --- a/docs/topics/auth/customizing.txt +++ b/docs/topics/auth/customizing.txt @@ -202,10 +202,7 @@ fairly simply:: class SettingsBackend(object): ... def has_perm(self, user_obj, perm, obj=None): - if user_obj.username == settings.ADMIN_LOGIN: - return True - else: - return False + return user_obj.username == settings.ADMIN_LOGIN 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