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

Fix bug where custom permission groups are missing #1636

Merged

Conversation

derek-ho
Copy link
Collaborator

@derek-ho derek-ho commented Nov 1, 2023

Description

Fix custom/kibana/all permission groups missing from dropdown. This was because I had assumed there were only "cluster" and "index" type groups, whereas there are also custom, kibana, and all types for permission groups. This has slight duplication since the custom types will show up in both cluster and index dropdowns, but this fixes the bug.

More details here: #1636 (comment)

Category

[Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation]

Why these changes are required?

What is the old behavior before changes and new behavior after changes?

Issues Resolved

FIX: #1597

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@derek-ho derek-ho changed the title Fix bug where custom/non cluster/index permission groups were being l… Fix bug where custom permission groups are missing Nov 1, 2023
@derek-ho
Copy link
Collaborator Author

derek-ho commented Nov 1, 2023

Brief description/background of the change. The following are the types of groups:

type: 'cluster' | 'index' | 'all' | 'kibana' | undefined;
. cluster and index are self explanatory and are already being filtered in the section, which I have renamed to be more specific about the groups. There is also kibana, which corresponds to dashboards action groups, which are handled in the Tenant Panel (i.e. not relevant to this PR). There is also all, which corresponds to unlimited, which describes the following group:

{
    "reserved": true,
    "hidden": false,
    "allowed_actions": [
        "*"
    ],
    "type": "all",
    "description": "Allow all",
    "static": true
}

Not sure how this would be used, hence only restricting other permission groups to undefined, which corresponds to custom permission groups, addressing the initial issue.

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Merging #1636 (95a083e) into main (c784665) will decrease coverage by 1.70%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1636      +/-   ##
==========================================
- Coverage   67.99%   66.29%   -1.70%     
==========================================
  Files          93       93              
  Lines        2340     2344       +4     
  Branches      317      317              
==========================================
- Hits         1591     1554      -37     
  Misses        720      720              
- Partials       29       70      +41     
Files Coverage Δ
.../apps/configuration/panels/role-edit/role-edit.tsx 84.37% <100.00%> (+1.04%) ⬆️

... and 17 files with indirect coverage changes

Copy link
Member

@cwperks cwperks left a comment

Choose a reason for hiding this comment

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

This PR looks good to me, but IMO this experience is a bit confusing and should be better addressed in a future PR. There are 2 dropdowns in the frontend where permissions groups can be assigned. They are in the cluster permissions dropdown and the index permissions dropdown. From this, it is not abundantly clear which of those dropdowns a custom permission group would be applicable to.

@DarshitChanpura DarshitChanpura merged commit d14bb68 into opensearch-project:main Nov 2, 2023
8 of 9 checks passed
@DarshitChanpura DarshitChanpura added the backport 2.x backport to 2.x branch label Nov 2, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 2, 2023
DarshitChanpura pushed a commit that referenced this pull request Nov 3, 2023
) (#1639)

Signed-off-by: Derek Ho <[email protected]>
(cherry picked from commit d14bb68)

Co-authored-by: Derek Ho <[email protected]>
leanneeliatra pushed a commit to leanneeliatra/security-dashboards-plugin-fork that referenced this pull request Nov 17, 2023
@cwperks cwperks mentioned this pull request Jan 3, 2024
3 tasks
@cwperks cwperks mentioned this pull request Jan 25, 2024
3 tasks
@cwperks cwperks mentioned this pull request Mar 21, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Impossible to add customized permission group to a role
3 participants