Skip to content

Commit

Permalink
Handle other permission group types (#1715) (#1718)
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ac38d9d)

Co-authored-by: Craig Perkins <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and cwperks authored Jan 4, 2024
1 parent 45dc18e commit 3b18f53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 6 additions & 2 deletions public/apps/configuration/panels/role-edit/role-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ export function RoleEdit(props: RoleEditDeps) {
{
label: 'Other permission groups',
options: actionGroups
.filter((actionGroup) => actionGroup[1].type === undefined)
.filter(
(actionGroup) => !['cluster', 'index', 'kibana'].includes(actionGroup[1].type || '')
)
.map((actionGroup) => actionGroup[0])
.map(stringToComboBoxOption),
},
Expand All @@ -197,7 +199,9 @@ export function RoleEdit(props: RoleEditDeps) {
{
label: 'Other permission groups',
options: actionGroups
.filter((actionGroup) => actionGroup[1].type === undefined)
.filter(
(actionGroup) => !['cluster', 'index', 'kibana'].includes(actionGroup[1].type || '')
)
.map((actionGroup) => actionGroup[0])
.map(stringToComboBoxOption),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ describe('Role edit filtering', () => {
description: 'Custom group',
static: true,
},
unlimited: {
reserved: false,
hidden: false,
allowed_actions: ['*'],
type: 'all',
description: 'Unlimited group',
static: true,
},
});

it('basic cluster permission panel rendering', async () => {
Expand Down Expand Up @@ -118,6 +126,9 @@ describe('Role edit filtering', () => {
{
label: 'custom',
},
{
label: 'unlimited',
},
],
},
{
Expand Down Expand Up @@ -171,6 +182,9 @@ describe('Role edit filtering', () => {
{
label: 'custom',
},
{
label: 'unlimited',
},
],
},
{
Expand Down

0 comments on commit 3b18f53

Please sign in to comment.