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

Permissons #763

Draft
wants to merge 33 commits into
base: dev
Choose a base branch
from
Draft

Permissons #763

wants to merge 33 commits into from

Conversation

MadsNyl
Copy link
Contributor

@MadsNyl MadsNyl commented Feb 3, 2024

This PR will refactor the permission from viewsets to models. There are inconsistent use of permissions logic across the views and model.

This PR will also optimize the middleware for adding an user and id to a request, such that we don't check the user token from the db up to 3-5 times for each request.

Each model will now have permission functions that check retrieve, read, update, create, destroy and write_all for some models. The following models will be affected:

  • QRCode
  • Order
  • Jobpost
  • Notification
  • User
  • Cheatsheet
  • Category
  • Strike
  • Warning
  • Fine
  • UserNotificationSetting
  • Law
  • Picture
  • Album
  • Toddel
  • BadeCategory
  • UserBadge
  • WeeklyBusiness
  • Banner
  • Event
  • News
  • Page
  • Registration
  • ShortLink
  • StrikesOverview
  • Reaction
  • EventForm
  • Form
  • GroupForm
  • Submission
  • Group
  • Membership
  • MembershipHistory

@MadsNyl MadsNyl changed the title Trigger PR Permissons Feb 8, 2024
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.

None yet

1 participant