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)
This commit is contained in:
Klaas van Schelven
2024-09-10 08:51:00 +02:00
parent 3b0b11d069
commit d4d292e4be
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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