From c3042a5294a7438451a68bb96dc1c72ba12c7de7 Mon Sep 17 00:00:00 2001
From: Art Lukyanchyk <artiom.lukyanchyk@hs-hannover.de>
Date: Tue, 16 Jan 2018 16:45:58 +0100
Subject: [PATCH] Remove redundant su+staff permissions, now groups are used
 directly

---
 ssoauth/app_settings/defaults.py                    | 2 --
 ssoauth/management/commands/create_compat_groups.py | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/ssoauth/app_settings/defaults.py b/ssoauth/app_settings/defaults.py
index f8f20e5..1b511fa 100644
--- a/ssoauth/app_settings/defaults.py
+++ b/ssoauth/app_settings/defaults.py
@@ -51,9 +51,7 @@ SP_METADATA_LIFETIME_DAYS = 365 * 20
 PROJECT_NAME = os.environ.get('DJANGO_SETTINGS_MODULE').split('.')[0]
 
 SU_GROUP_NAME = "{0}_superusers".format(PROJECT_NAME)
-SU_PERM_NAME = "superuser"
 STAFF_GROUP_NAME = "{0}_staff".format(PROJECT_NAME)
-STAFF_PERM_NAME = "staff"
 
 PRETEND_AUTH_BACKEND = django_settings.AUTHENTICATION_BACKENDS[0]  # pretend to be this backend; django does not expect that it is possible to log in without an authentication backend
 
diff --git a/ssoauth/management/commands/create_compat_groups.py b/ssoauth/management/commands/create_compat_groups.py
index 62822d6..19e5975 100644
--- a/ssoauth/management/commands/create_compat_groups.py
+++ b/ssoauth/management/commands/create_compat_groups.py
@@ -13,8 +13,8 @@ class Command(BaseCommand):
 
     def handle(self, *args, **options):
         try:
-            self.ensure_group_exists(app_settings.SU_GROUP_NAME, [app_settings.SU_PERM_NAME])
-            self.ensure_group_exists(app_settings.STAFF_GROUP_NAME, [app_settings.STAFF_PERM_NAME])
+            self.ensure_group_exists(app_settings.SU_GROUP_NAME)
+            self.ensure_group_exists(app_settings.STAFF_GROUP_NAME)
         except Exception as e:
             raise CommandError("Could not ensure that compatibility groups and permissions exist. {0}".format(str(e)))
 
-- 
GitLab