From d4d292e4be5d027ba45944c2089f8771b8c01ebe Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Tue, 10 Sep 2024 08:51:00 +0200 Subject: [PATCH] Remove perm-based permission-checks For now, sticking to "how it actually works" is more important than "what we might need in the future". We don't have an admin-group with actually handed out perms yet, and we do have the recommendation to create a superuser in the installation docs. So let's just explicity check for that. (I found these checks while working on actual breakage in the previous commit) --- projects/views.py | 2 +- teams/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/views.py b/projects/views.py index 87ed8df..be8100a 100644 --- a/projects/views.py +++ b/projects/views.py @@ -213,7 +213,7 @@ def project_members_invite(request, project_pk): if get_settings().USER_REGISTRATION in [CB_ANYBODY, CB_MEMBERS]: user_must_exist = False - elif get_settings().USER_REGISTRATION == CB_ADMINS and request.user.has_perm("users.add_user"): + elif get_settings().USER_REGISTRATION == CB_ADMINS and request.user.is_superuser: user_must_exist = False else: user_must_exist = True diff --git a/teams/views.py b/teams/views.py index ac0bd78..fdf0b33 100644 --- a/teams/views.py +++ b/teams/views.py @@ -180,7 +180,7 @@ def team_members_invite(request, team_pk): if get_settings().USER_REGISTRATION in [CB_ANYBODY, CB_MEMBERS]: user_must_exist = False - elif get_settings().USER_REGISTRATION == CB_ADMINS and request.user.has_perm("users.add_user"): + elif get_settings().USER_REGISTRATION == CB_ADMINS and request.user.is_superuser: user_must_exist = False else: user_must_exist = True