Add rbac to teams endpoint (#1592)
# What this PR does ## Which issue(s) this PR fixes ## Checklist - [ ] Tests updated - [ ] Documentation added - [ ] `CHANGELOG.md` updated
This commit is contained in:
parent
748e8462a4
commit
d5079d9ffc
1 changed files with 7 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ from rest_framework import mixins, viewsets
|
|||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.response import Response
|
||||
|
||||
from apps.api.permissions import RBACPermission
|
||||
from apps.api.serializers.team import TeamSerializer
|
||||
from apps.auth_token.auth import PluginAuthentication
|
||||
from apps.mobile_app.auth import MobileAppAuthTokenAuthentication
|
||||
|
|
@ -14,7 +15,12 @@ class TeamViewSet(PublicPrimaryKeyMixin, mixins.ListModelMixin, mixins.UpdateMod
|
|||
MobileAppAuthTokenAuthentication,
|
||||
PluginAuthentication,
|
||||
)
|
||||
permission_classes = (IsAuthenticated,)
|
||||
permission_classes = (IsAuthenticated, RBACPermission)
|
||||
rbac_permissions = {
|
||||
"list": [RBACPermission.Permissions.OTHER_SETTINGS_READ],
|
||||
"retrieve": [RBACPermission.Permissions.OTHER_SETTINGS_READ],
|
||||
"update": [RBACPermission.Permissions.OTHER_SETTINGS_WRITE],
|
||||
}
|
||||
|
||||
serializer_class = TeamSerializer
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue