Verified Commit 70fde26a authored by erdnaxe's avatar erdnaxe 🦋

Fix staff permissions

parent d711cd69
Pipeline #1398 failed with stage
in 3 minutes and 21 seconds
...@@ -19,7 +19,7 @@ class RightAdmin(VersionAdmin): ...@@ -19,7 +19,7 @@ class RightAdmin(VersionAdmin):
class ClefAdmin(VersionAdmin): class ClefAdmin(VersionAdmin):
list_display = ('proprio', 'nom') list_display = ('nom', 'proprio')
class AdhesionAdmin(VersionAdmin): class AdhesionAdmin(VersionAdmin):
......
...@@ -48,16 +48,9 @@ class User(AbstractUser): ...@@ -48,16 +48,9 @@ class User(AbstractUser):
except Right.DoesNotExist: except Right.DoesNotExist:
return False return False
def has_perm(self, perm, obj=None):
return True
def has_right(self, right): def has_right(self, right):
return Right.objects.filter(user=self).filter(right=ListRight.objects.get(listright=right)).exists() 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 @property
def is_adherent(self): def is_adherent(self):
last_adh_year = Adhesion.objects.all().order_by('annee_debut').reverse().first() last_adh_year = Adhesion.objects.all().order_by('annee_debut').reverse().first()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment