Fix staff permissions

This commit is contained in:
Alexandre Iooss 2019-08-08 13:42:47 +02:00
parent d711cd69e1
commit 70fde26afa
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
2 changed files with 1 additions and 8 deletions

View File

@ -19,7 +19,7 @@ class RightAdmin(VersionAdmin):
class ClefAdmin(VersionAdmin):
list_display = ('proprio', 'nom')
list_display = ('nom', 'proprio')
class AdhesionAdmin(VersionAdmin):

View File

@ -48,16 +48,9 @@ class User(AbstractUser):
except Right.DoesNotExist:
return False
def has_perm(self, perm, obj=None):
return True
def has_right(self, right):
return Right.objects.filter(user=self).filter(right=ListRight.objects.get(listright=right)).exists()
def has_module_perms(self, app_label):
# Simplest version again
return True
@property
def is_adherent(self):
last_adh_year = Adhesion.objects.all().order_by('annee_debut').reverse().first()