forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow applications to register feature privileges which are excluded …
…from the base privileges (elastic#41300) * Allowing features with reserved and normal privileges to be listed * Allowing privileges to be excluded from the base privileges * Defaulting to custom when creating new privilege entries * Adjusting logic for the privilege space table and adding tests Prior to these changes, if we gave the user global base all and then a custom set of privileges at a space granting access to the reservedAndNormal feature, it'd show "All" for the space specific privileges. * Better naming for tests * Using a common rawKibanaPrivileges fixture * Rendering tooltip when feature isn't part of the base privileges * i18n'ing a string * Properly i18n'ing the string?
- Loading branch information
Showing
14 changed files
with
1,075 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...dit_role/components/privileges/kibana/space_aware_privilege_section/__fixtures__/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export { rawKibanaPrivileges } from './raw_kibana_privileges'; |
29 changes: 29 additions & 0 deletions
29
...nts/privileges/kibana/space_aware_privilege_section/__fixtures__/raw_kibana_privileges.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { RawKibanaPrivileges } from '../../../../../../../../../common/model'; | ||
|
||
export const rawKibanaPrivileges: RawKibanaPrivileges = { | ||
global: { | ||
all: ['normal-feature-all', 'normal-feature-read', 'just-global-all'], | ||
read: ['normal-feature-read'], | ||
}, | ||
space: { | ||
all: ['normal-feature-all', 'normal-feature-read'], | ||
read: ['normal-feature-read'], | ||
}, | ||
reserved: {}, | ||
features: { | ||
normal: { | ||
all: ['normal-feature-all', 'normal-feature-read'], | ||
read: ['normal-feature-read'], | ||
}, | ||
excludedFromBase: { | ||
all: ['excluded-from-base-all', 'excluded-from-base-read'], | ||
read: ['excluded-from-base-read'], | ||
}, | ||
}, | ||
}; |
92 changes: 84 additions & 8 deletions
92
...ges/kibana/space_aware_privilege_section/__snapshots__/privilege_space_form.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.