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

feat: fetch and display the ReBAC model access #1889

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

huwshimi
Copy link
Contributor

@huwshimi huwshimi commented Mar 12, 2025

Done

  • Fetch the user's relations to a model and use them to display their model access entitlement on the model details page.

QA

  • Connect to JIMM.
  • Turn on ReBAC with ?enable-flag=rebac.
  • Go to a model and on the left hand side you should see your access.

Details

https://warthogs.atlassian.net/browse/WD-19884

@webteam-app
Copy link

Copy link

github-actions bot commented Mar 12, 2025

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 97.98% (🎯 95%) 14724 / 15027
🟢 Statements 97.98% (🎯 95%) 14724 / 15027
🟢 Functions 98.24% (🎯 95%) 614 / 625
🟢 Branches 92.4% (🎯 90%) 3089 / 3343
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/EntityInfo/EntityInfo.tsx 100% 100% 100% 100%
src/components/TruncatedTooltip/TruncatedTooltip.tsx 96.29% 85.71% 100% 96.29% 55-56
src/hooks/useModelAccess.ts 100% 100% 100% 100%
src/juju/api-hooks/permissions.ts 100% 100% 100% 100%
src/juju/jimm/JIMMV4.ts 100% 100% 100% 100%
src/juju/jimm/api.ts 100% 100% 100% 100%
src/pages/EntityDetails/Model/Model.tsx 98.91% 94.73% 100% 98.91% 63-64
src/store/juju/selectors.ts 97.37% 94.03% 100% 97.37% 551-552, 587-588, 699, 723, 730, 736-737, 812-813, 836-837, 873-874, 899-900, 928-929
src/store/juju/slice.ts 98.08% 91.8% 100% 98.08% 109-110, 134-135, 274-275, 277-278
src/store/middleware/check-auth.ts 97.27% 94.73% 100% 97.27% 36-40
src/store/middleware/model-poller.ts 96.12% 91.66% 100% 96.12% 61-62, 123-130, 165-166, 216, 414, 455
Generated in workflow #232 for commit c60b3f7 by the Vitest Coverage Report Action

@Ninfa-Jeon
Copy link
Contributor

Screenshot 2025-03-12 at 4 48 42 PM is this expected?

@huwshimi
Copy link
Contributor Author

is this expected?

No, it's not! One thing is that you need to turn on the flag with ?enable-flag=rebac (I forgot to add that to the instructions).

For some reason on the deployed JIMM it's not returning any relations to the model (whereas I get these with a local JIMM). This might be because the model access is via a group instead of a direct relation. I'll clarify what the API is meant to return and update this PR if needed.

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.

3 participants