BENCH-418 & BENCH-422: Authentication and permissions#90
BENCH-418 & BENCH-422: Authentication and permissions#90MichaelOSullivanAnswer wants to merge 14 commits intodevelopfrom
Conversation
…Views to aid permissions setting
|
Still need to update tests. |
| @@ -1,11 +1,17 @@ | |||
| import re | |||
| from abc import ABC | |||
| pass | ||
|
|
||
|
|
||
| class IsManagerUser(BasePermission): |
There was a problem hiding this comment.
this is the same as IsStaffUser so can get rid of this
| "errors": {"name": "The name field is required."}, | ||
| "type": "https://testserver/problems/error/", | ||
| "title": "One or more validation errors occurred.", | ||
| "title": "One or more permissions errors occurred.", |
There was a problem hiding this comment.
probably would change this to "One or more validation or permissions errors occurred."
| class RegisterManagerView( | ||
| generics.CreateAPIView, | ||
| ): | ||
| permission_classes = (AllowAny,) |
There was a problem hiding this comment.
should this be "IsStaffUser" rather than AllowAny?
| mixins.CreateModelMixin, | ||
| generics.GenericAPIView, | ||
| ): | ||
| permission_classes = [] |
There was a problem hiding this comment.
should this have "IsStaffUser" s its permission?
| mixins.UpdateModelMixin, | ||
| generics.GenericAPIView, | ||
| ): | ||
| permission_classes = [] |
There was a problem hiding this comment.
should this have "IsStaffUser" as its permission?
| RetireMixin, | ||
| generics.GenericAPIView, | ||
| ): | ||
| permission_classes = [] |
There was a problem hiding this comment.
should this have "IsStaffUser" as its permission?
| depth = 3 | ||
|
|
||
|
|
||
| class ManagerAuthSerializer(serializers.ModelSerializer): |
There was a problem hiding this comment.
If we are going with the permission as "IsStaffUser" we may want to change this to StaffAuthSerializer. Similar with a few other naming conventions further down also.
| "password", | ||
| "password2", |
There was a problem hiding this comment.
1 single password should be sent, password confirmation should be done by the front end
No description provided.