Skip to content

BENCH-418 & BENCH-422: Authentication and permissions - #90

Open
MichaelOSullivanAnswer wants to merge 14 commits into
developfrom
BENCH-422-permissions
Open

BENCH-418 & BENCH-422: Authentication and permissions#90
MichaelOSullivanAnswer wants to merge 14 commits into
developfrom
BENCH-422-permissions

Conversation

@MichaelOSullivanAnswer

Copy link
Copy Markdown
Contributor

No description provided.

@MichaelOSullivanAnswer

Copy link
Copy Markdown
ContributorAuthor

Still need to update tests.

@MichaelOSullivanAnswerMichaelOSullivanAnswer changed the title BENCH 418 & BENCH-422: Authentication and permissionsBENCH-418 & BENCH-422: Authentication and permissionsFeb 24, 2023
@@ -1,11 +1,17 @@
import re
from abc import ABC

Copy link
Copy Markdown
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):

@JoeCSykesJoeCSykesFeb 24, 2023

Copy link
Copy Markdown
Contributor

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

"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
Copy Markdown
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,)

@JoeCSykesJoeCSykesFeb 24, 2023

Copy link
Copy Markdown
Contributor

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 = []

@JoeCSykesJoeCSykesFeb 24, 2023

Copy link
Copy Markdown
Contributor

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 = []

@JoeCSykesJoeCSykesFeb 24, 2023

Copy link
Copy Markdown
Contributor

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 = []

@JoeCSykesJoeCSykesFeb 24, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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 threadanswerking_app/models/serializers.py
Comment on lines +343 to +344
"password",
"password2",

Copy link
Copy Markdown
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 freeto 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

@MichaelOSullivanAnswer@JoeCSykes@PietroConvalleAD