ФУНКЦИИ - МЕЖПРОЕКТНАЯ КОММУНИКАЦИЯ: блокировка и удаление участников воркспейса в God Mode
This commit is contained in:
@@ -9,6 +9,8 @@ from rest_framework import status
|
||||
|
||||
from enum import Enum
|
||||
|
||||
from plane.utils.workspace_bans import release_expired_workspace_bans
|
||||
|
||||
|
||||
class ROLE(Enum):
|
||||
ADMIN = 20
|
||||
@@ -20,6 +22,9 @@ def allow_permission(allowed_roles, level="PROJECT", creator=False, model=None):
|
||||
def decorator(view_func):
|
||||
@wraps(view_func)
|
||||
def _wrapped_view(instance, request, *args, **kwargs):
|
||||
if not request.user.is_anonymous and kwargs.get("slug"):
|
||||
release_expired_workspace_bans(member=request.user, workspace_slug=kwargs["slug"])
|
||||
|
||||
# Check for creator if required
|
||||
if creator and model:
|
||||
# check if the user is part of the workspace or not
|
||||
|
||||
Reference in New Issue
Block a user