Skip to content

Commit

Permalink
rbac: permissions endpoint: allow authenticated users (#12608)
Browse files Browse the repository at this point in the history
  • Loading branch information
rissson authored Jan 9, 2025
1 parent 9a1c76e commit ee12d5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions authentik/rbac/api/rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.db.models import QuerySet
from django_filters.filters import ModelChoiceFilter
from django_filters.filterset import FilterSet
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.exceptions import ValidationError
from rest_framework.fields import (
CharField,
Expand All @@ -13,6 +14,8 @@
ReadOnlyField,
SerializerMethodField,
)
from rest_framework.filters import OrderingFilter, SearchFilter
from rest_framework.permissions import IsAuthenticated
from rest_framework.viewsets import ReadOnlyModelViewSet

from authentik.core.api.utils import ModelSerializer, PassiveSerializer
Expand Down Expand Up @@ -92,7 +95,9 @@ class RBACPermissionViewSet(ReadOnlyModelViewSet):
queryset = Permission.objects.none()
serializer_class = PermissionSerializer
ordering = ["name"]
filter_backends = [DjangoFilterBackend, OrderingFilter, SearchFilter]
filterset_class = PermissionFilter
permission_classes = [IsAuthenticated]
search_fields = [
"codename",
"content_type__model",
Expand Down

0 comments on commit ee12d5a

Please sign in to comment.