"""Permission policies for the tasks HTTP API.""" from rest_framework.permissions import BasePermission class CanAccessTaskAutomationAPI(BasePermission): """Preserve the current shared-rules policy behind an explicit boundary. Fine-grained board and task access is enforced by the application use case. Keeping the HTTP-level policy named makes a future role split local instead of scattering authentication checks across view actions. """ message = "Для работы с автоматизациями требуется авторизация." def has_permission(self, request, view) -> bool: return bool(request.user and request.user.is_authenticated)