Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add user permission API endpoints #29706

Merged
merged 1 commit into from
Nov 2, 2021
Merged

Conversation

dcramer
Copy link
Member

@dcramer dcramer commented Nov 1, 2021

Add ability to list, test, add, and delete permissions from individual users.

  • GET /users/me/permissions/
  • GET /users/me/permissions/permission.name/
  • POST /users/me/permissions/permission.name/
  • DELETE /users/me/permissions/permission.name/

@dcramer dcramer requested a review from markstory November 1, 2021 22:33
try:
with transaction.atomic():
UserPermission.objects.create(user=user, permission=permission_name)
except IntegrityError:
Copy link
Member Author

Choose a reason for hiding this comment

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

i still dream of an except DuplicateKeyConstraint

Copy link
Member

@markstory markstory left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Add ability to list, test, add, and delete permissions from individual users.

- GET /users/me/permissions/
- GET /users/me/permissions/permission.name/
- POST /users/me/permissions/permission.name/
- DELETE /users/me/permissions/permission.name/
@dcramer dcramer merged commit 3c3ee47 into master Nov 2, 2021
@dcramer dcramer deleted the feat/user-permissions-api branch November 2, 2021 19:23
@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants