expephalon/core/modules/permissions.py

15 lines
424 B
Python
Raw Normal View History

2020-06-03 15:05:18 +00:00
import importlib
from django.conf import settings
admin_permissions = []
for module in ["core"] + settings.EXPEPHALON_MODULES:
try:
mop = importlib.import_module(f"{module}.permissions")
for admin_permission in mop.ADMIN_PERMISSIONS:
admin_permissions.append(admin_permission)
except (AttributeError, ModuleNotFoundError):
continue
admin_permissions = tuple(admin_permissions)