Added ‘view virtual machine plan ’ permission, Added ‘delete virtual machine plan’ permission , Added ‘view hosting order’ permission
This commit is contained in:
parent
3e6502133e
commit
4352094680
7 changed files with 47 additions and 16 deletions
|
|
@ -17,7 +17,8 @@ REGISTRATION_MESSAGE = {'subject': "Validation mail",
|
|||
|
||||
|
||||
def get_anonymous_user_instance(User):
|
||||
return User.register('Anonymous', None, 'anonymous@ungleich.ch')
|
||||
return CustomUser(name='Anonymous', email='anonymous@ungleich.ch',
|
||||
validation_slug=make_password(None))
|
||||
|
||||
|
||||
|
||||
|
|
@ -108,10 +109,10 @@ class CustomUser(AbstractBaseUser, PermissionsMixin):
|
|||
def __str__(self): # __unicode__ on Python 2
|
||||
return self.email
|
||||
|
||||
def has_perm(self, perm, obj=None):
|
||||
"Does the user have a specific permission?"
|
||||
# Simplest possible answer: Yes, always
|
||||
return self.is_admin
|
||||
# def has_perm(self, perm, obj=None):
|
||||
# "Does the user have a specific permission?"
|
||||
# # Simplest possible answer: Yes, always
|
||||
# return self.is_admin
|
||||
|
||||
def has_module_perms(self, app_label):
|
||||
"Does the user have permissions to view the app `app_label`?"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue