diff --git a/api/desecapi/permissions.py b/api/desecapi/permissions.py index f492f4e8a..b20ca4d1c 100644 --- a/api/desecapi/permissions.py +++ b/api/desecapi/permissions.py @@ -90,7 +90,7 @@ def has_permission(self, request, view): return ip in IPv4Network('10.8.0.0/24') -class ManageTokensPermission(permissions.BasePermission): +class HasManageTokensPermission(permissions.BasePermission): """ Permission to check whether a token has "manage tokens" permission. """ diff --git a/api/desecapi/views.py b/api/desecapi/views.py index 7074ed107..08e90aa23 100644 --- a/api/desecapi/views.py +++ b/api/desecapi/views.py @@ -69,7 +69,7 @@ def destroy(self, request, *args, **kwargs): class TokenViewSet(IdempotentDestroyMixin, viewsets.ModelViewSet): serializer_class = serializers.TokenSerializer - permission_classes = (IsAuthenticated, permissions.ManageTokensPermission,) + permission_classes = (IsAuthenticated, permissions.HasManageTokensPermission,) throttle_scope = 'account_management_passive' def get_queryset(self): @@ -173,9 +173,9 @@ class TokenDomainPolicyViewSet(IdempotentDestroyMixin, viewsets.ModelViewSet): def permission_classes(self): ret = [IsAuthenticated] if self.request.method in SAFE_METHODS: - ret.append(permissions.ManageTokensPermission | permissions.AuthTokenCorrespondsToViewToken) + ret.append(permissions.HasManageTokensPermission | permissions.AuthTokenCorrespondsToViewToken) else: - ret.append(permissions.ManageTokensPermission) + ret.append(permissions.HasManageTokensPermission) return ret def dispatch(self, request, *args, **kwargs):