Skip to content

feat: Tool permissions#1001

Merged
david-okeke1337 merged 16 commits intodevfrom
feature/tool-permissions
May 7, 2026
Merged

feat: Tool permissions#1001
david-okeke1337 merged 16 commits intodevfrom
feature/tool-permissions

Conversation

@david-okeke1337
Copy link
Copy Markdown
Contributor

@david-okeke1337 david-okeke1337 commented Apr 24, 2026

Signed-off-by: DBT pre-commit check

Context

This PR adds tool permission management for users. This can be via a user directly or an access rule.
This PR also optimises sso endpoint hits/dependencies by caching response data onto a dedicated UserSSO model.

What

  • Created UserSSO models
  • Created sso service
  • Synced sso data on user login
  • Created ToolAccessRule model
  • Created add UserTool form and views
  • Created ToolAccessRule model and forms
  • Added is_public flag to Tool model
  • Implemented Tool permissions backend
  • Created and updated some html templates and macros
  • Added tool settings edit button to tool card (TBD)
  • Created govuk base form
  • Removed CustomFlag model and references

Have you written unit tests?

  • Yes
  • No (add why you have not)

Are there any specific instructions on how to test this change?

  • Yes (if so provide more detail)
  • No

  • Ensure tool permissions can be managed via the front-end.

Relevant links

UserSSO model
image
Tool settings page
image
Bulk add tool users form
image
edit tool user - expandable row form
image
Add/edit tool access rule form
image
ToolAccessRule model
image
Add/edit tool access rule form - preview
image

…to tools landing page

Signed-off-by: DBT pre-commit check
@david-okeke1337 david-okeke1337 requested a review from a team as a code owner April 24, 2026 10:14
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 73.04189% with 148 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.60%. Comparing base (fd9550a) to head (2c574ce).

Files with missing lines Patch % Lines
...go_app/redbox_app/redbox_core/views/tools_views.py 42.28% 86 Missing ⚠️
django_app/redbox_app/redbox_core/forms.py 48.68% 39 Missing ⚠️
django_app/redbox_app/redbox_core/models.py 95.18% 8 Missing ⚠️
django_app/redbox_app/jinja2.py 20.00% 4 Missing ⚠️
django_app/redbox_app/redbox_core/views/mixins.py 40.00% 3 Missing ⚠️
django_app/redbox_app/redbox_core/admin.py 92.00% 2 Missing ⚠️
...jango_app/redbox_app/redbox_core/services/chats.py 66.66% 2 Missing ⚠️
django_app/redbox_app/redbox_core/services/sso.py 96.15% 2 Missing ⚠️
django_app/redbox_app/redbox_core/utils.py 66.66% 1 Missing ⚠️
...ngo_app/redbox_app/redbox_core/views/chat_views.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1001      +/-   ##
==========================================
- Coverage   83.32%   81.60%   -1.72%     
==========================================
  Files          32      201     +169     
  Lines        4125     8715    +4590     
==========================================
+ Hits         3437     7112    +3675     
- Misses        688     1603     +915     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

david-okeke1337 and others added 8 commits April 29, 2026 15:08
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Comment thread django_app/redbox_app/redbox_core/views/tools_views.py Fixed
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Signed-off-by: DBT pre-commit check
Comment thread django_app/tests/models/test_user_sso_model.py Dismissed
Comment thread django_app/tests/models/test_user_sso_model.py Dismissed
@david-okeke1337 david-okeke1337 changed the title feat: Tool permissions - WIP feat: Tool permissions May 7, 2026
@david-okeke1337 david-okeke1337 merged commit d75b6bf into dev May 7, 2026
15 checks passed
@david-okeke1337 david-okeke1337 deleted the feature/tool-permissions branch May 7, 2026 09:10
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.

4 participants