Files
Tablequizwiki/lib/__init__.py
2024-07-04 14:05:55 +02:00

12 lines
263 B
Python

from .middleware.current_user import get_current_user, get_current_request
def permissions(instance, read = False):
if read:
return True
u = get_current_user()
if u.is_superuser or u == instance.author:
return True
return False