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

[PUI] Add permissions to groups #7621

Merged
merged 24 commits into from
Jul 22, 2024

Conversation

matmair
Copy link
Member

@matmair matmair commented Jul 11, 2024

This PR replaces the placeholder for group permissions with a row of accordions listing the permissions.
For this the PR:

  • adds the Group model to various integrated rendering methods
  • adds permissions and an admin button to the Group detail drawer
  • adds permissions optionally to group serializers
  • changes the creation of new groups to add no permissions by default (old default was view on everything)

Screenshots

grafik

grafik

@matmair matmair added enhancement This is an suggested enhancement or new feature Platform UI Related to the React based User Interface labels Jul 11, 2024
@matmair matmair added this to the 0.16.0 milestone Jul 11, 2024
@matmair matmair self-assigned this Jul 11, 2024
Copy link

netlify bot commented Jul 11, 2024

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 6fc70f8
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/669d165ca88d5a00086e3fc9

@matmair
Copy link
Member Author

matmair commented Jul 11, 2024

@SchrodingersGat what is the current way to expose endpoint filters to the schema generator?

Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 84.05797% with 11 lines in your changes missing coverage. Please review.

Project coverage is 83.65%. Comparing base (afad866) to head (6fc70f8).
Report is 312 commits behind head on master.

Files with missing lines Patch % Lines
src/frontend/src/tables/settings/GroupTable.tsx 0.00% 6 Missing ⚠️
src/backend/InvenTree/users/api.py 81.81% 2 Missing ⚠️
src/backend/InvenTree/InvenTree/test_api.py 91.66% 1 Missing ⚠️
src/backend/InvenTree/users/serializers.py 95.45% 1 Missing ⚠️
src/frontend/src/components/render/User.tsx 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7621      +/-   ##
==========================================
- Coverage   83.70%   83.65%   -0.05%     
==========================================
  Files        1105     1106       +1     
  Lines       48869    48920      +51     
  Branches     1576     1578       +2     
==========================================
+ Hits        40906    40925      +19     
- Misses       7548     7585      +37     
+ Partials      415      410       -5     
Flag Coverage Δ
backend 85.21% <93.22%> (+<0.01%) ⬆️
pui 64.84% <30.00%> (-0.34%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@SchrodingersGat
Copy link
Member

what is the current way to expose endpoint filters to the schema generator?

Sorry, what do you mean by "endpoint filters"?

@matmair
Copy link
Member Author

matmair commented Jul 15, 2024

@SchrodingersGat path parameters like include_stock - I am a bit lost about how those get exposed to the schema right now?

@SchrodingersGat
Copy link
Member

@matmair mostly they don't. There are a few "hidden" constructs in the API - which I am slowly working through and fixing. But, mostly the extra "detail" filters are handled manually and thus not exposed to the schema

@matmair
Copy link
Member Author

matmair commented Jul 16, 2024

Ok, so I do not need to expose them?

@SchrodingersGat
Copy link
Member

Ok, so I do not need to expose them?

No, no need to.

@matmair matmair marked this pull request as ready for review July 18, 2024 21:32
@matmair
Copy link
Member Author

matmair commented Jul 18, 2024

@SchrodingersGat @wolflu05 ready for review

@matmair
Copy link
Member Author

matmair commented Jul 21, 2024

@SchrodingersGat I have fixed the CI tests by adjusting to the changed defaults and adding the missing permissions to the test classes

@SchrodingersGat SchrodingersGat added the api Relates to the API label Jul 22, 2024
@SchrodingersGat
Copy link
Member

@matmair nice work, this is a good addition to the new interface.

@SchrodingersGat SchrodingersGat merged commit ffd55cf into inventree:master Jul 22, 2024
26 checks passed
@SchrodingersGat SchrodingersGat deleted the add-permissions-to-pui branch July 22, 2024 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API enhancement This is an suggested enhancement or new feature Platform UI Related to the React based User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants