permission.granted_to now handle anonymous user
This commit is contained in:
parent
d9c3e214e0
commit
95893c04d9
1 changed files with 2 additions and 0 deletions
|
@ -392,6 +392,8 @@ class PermissionModel(models.Model):
|
|||
abstract = True
|
||||
|
||||
def granted_to(self, user):
|
||||
if not user.is_authenticated():
|
||||
return False
|
||||
if self.grantee_type == self.GRANTEE_USER:
|
||||
return user.username == self.grantee_name
|
||||
elif self.grantee_type == self.GRANTEE_GROUP:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue