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(config): ent-3828 generate permissions from rbac #655

Merged
merged 1 commit into from
May 4, 2021

Conversation

cdcabrera
Copy link
Member

@cdcabrera cdcabrera commented May 4, 2021

What's included

  • feat(config): ent-3828 generate permissions from rbac
    • config, rbac permissions
    • platformServices, allow appName for getUserPermissions
    • userSelectors, use permissions instead of hard coded aliases
    • userServices, allow multiple app permission checks

Notes

  • the original request was specific to the read level permissions of "reports". However, based on our past implementation of inventory and hosts it needs to be confirmed that "read" and only "read" has access to view the interface
    • What was requested... reports:read
    • What is implemented with this PR is for reports:*, reports:read, and reports:write to all have access. This is now more easily added/removed by editing the rbac.json config file
  • @ntkathole

How to test

Proxy run check

  1. update the NPM packages with $ yarn
  2. make sure Docker is running, plus on network, then
  3. $ yarn start:proxy
  4. login with the following types of account permissions to confirm behavior
    • app = subscriptions resource = * operation = *, all perms (Subscriptions should be available)
    • app = subscriptions resource = reports operation = *, all perms (Subscriptions should be available)
    • app = subscriptions resource = reports operation = read, read perms (Subscriptions should be available)
    • app = subscriptions resource = reports operation = write, write perms (Subscriptions should be available)
    • app = inventory resource = hosts operation = *, all perms (links for inventory should appear)
    • app = inventory resource = hosts operation = read, read perms (links for inventory should appear)
    • app = inventory resource = hosts operation = write, write perms (links for inventory should appear)

Example

...

Updates issue/story

ent-3828
relates ENT-2745

@cdcabrera cdcabrera added bug Something isn't working platform Contains, or is, platform specific work and issues 202108 project phase labels May 4, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #655 (067b8b3) into ci (dd86f1d) will decrease coverage by 0.03%.
The diff coverage is 92.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##               ci     #655      +/-   ##
==========================================
- Coverage   93.76%   93.72%   -0.04%     
==========================================
  Files          87       87              
  Lines        2646     2646              
  Branches      931      927       -4     
==========================================
- Hits         2481     2480       -1     
- Misses        141      142       +1     
  Partials       24       24              
Impacted Files Coverage Δ
src/types/platformApiTypes.js 100.00% <ø> (ø)
src/services/userServices.js 97.22% <83.33%> (-2.78%) ⬇️
src/redux/selectors/userSelectors.js 100.00% <100.00%> (ø)
src/services/platformServices.js 97.67% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd86f1d...067b8b3. Read the comment docs.

* config, rbac permissions
* platformServices, allow appName for getUserPermissions
* userSelectors, use permissions instead of hard coded aliases
* userServices, allow multiple app permission checks
@cdcabrera cdcabrera marked this pull request as ready for review May 4, 2021 13:38
@cdcabrera cdcabrera merged commit cc3843b into RedHatInsights:ci May 4, 2021
cdcabrera added a commit that referenced this pull request May 4, 2021
* config, rbac permissions
* docs, contributing.md for local dev
* platformApi const, remove unused constants
* platformServices, allow appName for getUserPermissions
* userSelectors, use config instead of hard coded aliases
* userServices, allow multiple app permission checks
@cdcabrera cdcabrera changed the title fix(rbac): ent-3828 generate permissions from config feat(config): ent-3828 generate permissions from rbac May 4, 2021
@cdcabrera cdcabrera added the tech debt We've ignored it this long... label May 4, 2021
cdcabrera added a commit that referenced this pull request May 11, 2021
* config, rbac permissions
* docs, contributing.md for local dev
* platformApi const, remove unused constants
* platformServices, allow appName for getUserPermissions
* userSelectors, use config instead of hard coded aliases
* userServices, allow multiple app permission checks
cdcabrera added a commit that referenced this pull request May 12, 2021
* config, rbac permissions
* docs, contributing.md for local dev
* platformApi const, remove unused constants
* platformServices, allow appName for getUserPermissions
* userSelectors, use config instead of hard coded aliases
* userServices, allow multiple app permission checks
cdcabrera added a commit that referenced this pull request May 12, 2021
* config, rbac permissions
* docs, contributing.md for local dev
* platformApi const, remove unused constants
* platformServices, allow appName for getUserPermissions
* userSelectors, use config instead of hard coded aliases
* userServices, allow multiple app permission checks
cdcabrera added a commit that referenced this pull request May 12, 2021
* config, rbac permissions
* docs, contributing.md for local dev
* platformApi const, remove unused constants
* platformServices, allow appName for getUserPermissions
* userSelectors, use config instead of hard coded aliases
* userServices, allow multiple app permission checks
cdcabrera added a commit that referenced this pull request May 18, 2021
* config, rbac permissions
* docs, contributing.md for local dev
* platformApi const, remove unused constants
* platformServices, allow appName for getUserPermissions
* userSelectors, use config instead of hard coded aliases
* userServices, allow multiple app permission checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
202108 project phase bug Something isn't working platform Contains, or is, platform specific work and issues tech debt We've ignored it this long...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants