Files
coulobre/src/coulobre/admin.py
T
parkel 39243a8ab3 Scope reseller access to assigned hosting accounts
Allow operators to assign accounts to resellers and give each reseller
read-only access to their own accounts and Apache previews.
2026-11-19 22:16:29 +01:00

16 lines
428 B
Python

from django.contrib.admin import AdminSite
from django.contrib.admin.apps import AdminConfig
from .hosting.access import reseller_for_user
class CoulobreAdminSite(AdminSite):
def has_permission(self, request):
return (
super().has_permission(request) and reseller_for_user(request.user) is None
)
class CoulobreAdminConfig(AdminConfig):
default_site = "coulobre.admin.CoulobreAdminSite"