Skip to content

User permissions check for Attachment API - #12689

Merged
SchrodingersGat merged 1 commit into
inventree:masterfrom
SchrodingersGat:attachment-permissions
Aug 23, 2026
Merged

SchrodingersGat merged 1 commit into
inventree:masterfrom
SchrodingersGat:attachment-permissions

Conversation

@SchrodingersGat

Copy link
Copy Markdown
Member
  • Check user role permissions when retrieving Attachment objects via the API
  • Hide entries that the user does not have appropriate view role for
  • Return PermissionDenied if the user tries GET access

@SchrodingersGat SchrodingersGat added this to the 1.6.0 milestone Aug 23, 2026
@SchrodingersGat SchrodingersGat added api Relates to the API security Relates to a security issue backport Apply this label to a PR to enable auto-backport action backport-to-1.5.x labels Aug 23, 2026
@netlify

netlify Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit 4ab2479
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a8a548098e4c300085e6869

@codecov

codecov Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.79%. Comparing base (f063a6c) to head (4ab2479).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12689   +/-   ##
=======================================
  Coverage   86.78%   86.79%           
=======================================
  Files        1455     1455           
  Lines       97521    97563   +42     
  Branches    11402    11402           
=======================================
+ Hits        84637    84680   +43     
+ Misses      12818    12817    -1     
  Partials       66       66           
Flag Coverage Δ
backend 90.87% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
Backend Apps 92.25% <100.00%> (+<0.01%) ⬆️
Backend General 93.78% <100.00%> (+0.04%) ⬆️
Frontend 79.62% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matmair matmair left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At this point we should probably make a custom viweset for these generic classes to ensure we do not have to patch out the same security converters with every single one

@SchrodingersGat

Copy link
Copy Markdown
Member Author

@matmair a common viewset for these common models would be a great idea

@SchrodingersGat
SchrodingersGat merged commit 528bb08 into inventree:master Aug 23, 2026
46 checks passed
@SchrodingersGat
SchrodingersGat deleted the attachment-permissions branch August 23, 2026 08:53
@github-actions

Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
✅ 1.5.x

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

matmair pushed a commit that referenced this pull request Aug 23, 2026
SchrodingersGat pushed a commit that referenced this pull request Sep 5, 2026
* Add SCIM
Closes #6339

* also test scim

* extend testing with conformance suite

* fix test suite results

* coverage completion

* fil test gaps

* add missing schema values

* fix more type issues

* fix error view

* remove route from OpenAPI

* User permissions check for Attachment API (#12689)

* enable oidc proivder by default

* add .well-known entry for OIDC server

* add default client registration

* add changelog entry

* add codeowners

* remove redundant info

* re-name and restructure panel

* add a smal explainer section on top

* flesh out section a bit more

* change name

* basic sso panel

* refactor rendering

* add api and mgmt functions

* add create/delete options

* simplify test

* handle secret generation

* fix merge

* update coverage

* add test

* reduce user friction

* add better labels

* make it more clear that this is only shown once

* add regenerate function

* update tests

* simplify test calls

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Relates to the API backport Apply this label to a PR to enable auto-backport action backport-to-1.5.x security Relates to a security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants