mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-10 17:31:03 +00:00
8f57aa5f37
Redoes the UI to remove timelines, promote domains, and a lot of other things to support the refactor.
11 lines
340 B
Python
11 lines
340 B
Python
from django.contrib.auth.decorators import user_passes_test
|
|
|
|
|
|
def moderator_required(function):
|
|
return user_passes_test(
|
|
lambda user: user.is_authenticated and (user.admin or user.moderator)
|
|
)(function)
|
|
|
|
|
|
def admin_required(function):
|
|
return user_passes_test(lambda user: user.is_authenticated and user.admin)(function)
|