mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Solution][Endpoint] Require all spaces flag for sub features (#143733)
* Adds requireAllSpaces flag for subfeatures. * fixes ts errors * Adds unit test on sub features form UI * Adds unit test for validateKibanaPrivileges function with subfeatures * Fixes failing tests * Rename some vars and reorder return null. Also skip two tests that are not working as expected * Reorder if condition for performance optimisation * Fixes unit test * PR feedback - remove useMemo and use a function Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
0c1ae8c1c2
commit
217d2d0c4e
17 changed files with 609 additions and 22 deletions
|
@ -16,6 +16,17 @@ export interface SubFeatureConfig {
|
|||
/** Display name for this sub-feature */
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* Whether or not this privilege should only be granted to `All Spaces *`. Should be used for features that do not
|
||||
* support Spaces. Defaults to `false`.
|
||||
*/
|
||||
requireAllSpaces?: boolean;
|
||||
|
||||
/**
|
||||
* Optional message to display on the Role Management screen when configuring permissions for this feature.
|
||||
*/
|
||||
privilegesTooltip?: string;
|
||||
|
||||
/** Collection of privilege groups */
|
||||
privilegeGroups: readonly SubFeaturePrivilegeGroupConfig[];
|
||||
}
|
||||
|
@ -90,6 +101,10 @@ export class SubFeature {
|
|||
return this.config.privilegeGroups;
|
||||
}
|
||||
|
||||
public get requireAllSpaces() {
|
||||
return this.config.requireAllSpaces ?? false;
|
||||
}
|
||||
|
||||
public toRaw() {
|
||||
return { ...this.config };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue