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

Fixed RA user can approve reservation issues #280

Merged
merged 2 commits into from
Sep 5, 2023

Conversation

SanttuA
Copy link
Collaborator

@SanttuA SanttuA commented Aug 31, 2023

Fix to RA user management "can approve reservation" permission issues

Changes:

  • it is no longer assumed user has can_approve_reservation permission when they have unit manager permissions
  • when all unit's permissions get deleted, can_approve_reservation is also removed from user if the user had it
  • when clicking to toggle can_approve_reservation, all check boxes belonging to the same unit, will change to the same value

Related Trello card


Breakdown:

RA user can approve reservation issues

  1. respa_admin/forms.py

    • no longer assume manager has/gets can_approve_reservation
    • when form gets delete command set can_approve_reservation to false
  2. respa_admin/static_src/js/userForm.js

    • added function to handle can approve reservation toggling to affect all check boxes of the same unit
  3. respa_admin/templatetags/templatetags.py

    • no longer assume manager has/gets can_approve_reservation

Changes:
- it is no longer assumed user has `can_approve_reservation` permission when they have unit manager permissions
- when all unit's permissions get deleted, `can_approve_reservation` is also removed from user if the user had it
- when clicking to toggle `can_approve_reservation`, all checkboxes belonging to the same unit, will change to the same value
@SanttuA SanttuA requested a review from ezkat August 31, 2023 11:30
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Patch coverage: 20.00% and project coverage change: +0.07% 🎉

Comparison is base (e030a41) 76.51% compared to head (10d35f7) 76.59%.
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #280      +/-   ##
===========================================
+ Coverage    76.51%   76.59%   +0.07%     
===========================================
  Files          485      496      +11     
  Lines        26436    26547     +111     
  Branches      2700     2705       +5     
===========================================
+ Hits         20228    20333     +105     
- Misses        5683     5689       +6     
  Partials       525      525              
Files Changed Coverage Δ
respa_admin/forms.py 64.02% <0.00%> (-0.60%) ⬇️
respa_admin/templatetags/templatetags.py 62.50% <50.00%> (ø)

... and 24 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SanttuA SanttuA merged commit 2ad57a6 into develop Sep 5, 2023
6 of 7 checks passed
@SanttuA SanttuA deleted the fix/ra-user-management-can-approve-reservation branch March 20, 2024 05:53
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.

2 participants