Allow operators to manage hosting as a customer
Coulobre Panel CI / Checks (Python 3.12) (pull_request) Successful in 2m0s
Coulobre Panel CI / Checks (Python 3.14) (pull_request) Successful in 2m14s

This commit is contained in:
parkel committed 2026-12-04 15:13:59 +01:00
1 parent 3131821afc
commit 9fb42d9625
33 files changed
+551 -88

No files matched your search

+13 -4
View File
@@ -121,11 +121,20 @@ def show_credential_action(request, kind):
)
def credential_actor(request):
return getattr(request, "support_operator", request.user)
def show_rotation_action(request, kind):
return (
getattr(request, "impersonation", None) is None
and enabled_rotation(request, kind)
and can_rotate_credentials(request.user, kind)
session = getattr(request, "impersonation", None)
if session is not None and not (
session.managed_enabled
and credential_actor(request).has_perms(CREDENTIAL_PERMISSIONS[kind])
and credential_actor(request).has_perm(ROTATION_PERMISSIONS[kind])
):
return False
return enabled_rotation(request, kind) and can_rotate_credentials(
request.user, kind
)