Skip to content

Conversation

MichaelOSullivanAnswer
Copy link
Contributor

No description provided.

@MichaelOSullivanAnswer
Copy link
Contributor Author

Still need to update tests.

@MichaelOSullivanAnswer MichaelOSullivanAnswer changed the title BENCH 418 & BENCH-422: Authentication and permissions BENCH-418 & BENCH-422: Authentication and permissions Feb 24, 2023
@@ -1,11 +1,17 @@
import re
from abc import ABC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this?

pass


class IsManagerUser(BasePermission):
Copy link
Contributor

@JoeCSykes JoeCSykes Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the same as IsStaffUser so can get rid of this

@@ -118,7 +118,7 @@
problem_detail_example: ProblemDetails = {
"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.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably would change this to "One or more validation or permissions errors occurred."

class RegisterManagerView(
generics.CreateAPIView,
):
permission_classes = (AllowAny,)
Copy link
Contributor

@JoeCSykes JoeCSykes Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be "IsStaffUser" rather than AllowAny?

mixins.CreateModelMixin,
generics.GenericAPIView,
):
permission_classes = []
Copy link
Contributor

@JoeCSykes JoeCSykes Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have "IsStaffUser" s its permission?

mixins.UpdateModelMixin,
generics.GenericAPIView,
):
permission_classes = []
Copy link
Contributor

@JoeCSykes JoeCSykes Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have "IsStaffUser" as its permission?

RetireMixin,
generics.GenericAPIView,
):
permission_classes = []
Copy link
Contributor

@JoeCSykes JoeCSykes Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this have "IsStaffUser" as its permission?

depth = 3


class ManagerAuthSerializer(serializers.ModelSerializer):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +343 to +344
"password",
"password2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 single password should be sent, password confirmation should be done by the front end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants