InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

feat(backend): add importer role

Open matmair opened this issue 8 months ago • 6 comments

Adds an importer role to enable locking import sessions down

matmair avatar Apr 09 '25 22:04 matmair

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

Name Link
Latest commit 8ea96930e300c1a132eaaab8f037697d14efa708
Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/67f762c524d1230008b447f9

netlify[bot] avatar Apr 09 '25 22:04 netlify[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 86.37%. Comparing base (15be7ab) to head (8ea9693). :warning: Report is 339 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9490      +/-   ##
==========================================
- Coverage   86.37%   86.37%   -0.01%     
==========================================
  Files        1228     1228              
  Lines       53773    53781       +8     
  Branches     2281     2281              
==========================================
+ Hits        46448    46453       +5     
- Misses       6748     6751       +3     
  Partials      577      577              
Flag Coverage Δ
backend 88.36% <100.00%> (+<0.01%) :arrow_up:

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

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Apr 09 '25 22:04 codecov[bot]

This will mean that any user who wants to import any data (not just via the admin interface, but for a specific BOM, etc) will need the additional "importer" role (in addition to the role associated with the model they are trying to import.. Is this what you are intending here?

Currently, a user must be have an "add" role permission against the target import model to import anything

SchrodingersGat avatar Apr 10 '25 03:04 SchrodingersGat

Yes, that is the idea. I was recently reminded how fast someone can fill an instance if they do not know what they are doing

matmair avatar Apr 10 '25 06:04 matmair

Ok, it seems reasonable - especially now that the UI for administering group roles is in place.

We should (as part of this) really enhance our documentation and role management:

  • What roles are available
  • What operations they control
  • How users are assigned "roles" based on the groups they are in

Are you happy to write up some enhanced documentation as part of this?

SchrodingersGat avatar Apr 10 '25 06:04 SchrodingersGat

I can do that but it has low priority for me

matmair avatar Apr 10 '25 07:04 matmair

Closing in favor of doing this right with https://github.com/inventree/InvenTree/issues/7466

matmair avatar Apr 28 '25 21:04 matmair