Skip to content

Commit

Permalink
Handle other permission group types
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Jan 3, 2024
1 parent 9c3ba49 commit 36f060f
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 @@ -175,7 +175,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 @@ -196,7 +198,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 36f060f

Please sign in to comment.