import { Role } from './types' ; export const noKibanaPrivileges = { name : 'no_kibana_privileges' , privileges : { elasticsearch : { indices : [ ] , } , } , } ; export const globalRead = { name : 'global_read' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { base : [ 'read' ] , spaces : [ '*' ] , } , ] , } , } ; export const securitySolutionOnlyAll = { name : 'sec_only_all_spaces_space1' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { siem : [ 'all' ] , } , spaces : [ 'space1' ] , } , ] , } , } ; export const securitySolutionOnlyAllSpace2 = { name : 'sec_only_all_spaces_space2' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { siem : [ 'all' ] , } , spaces : [ 'space2' ] , } , ] , } , } ; export const securitySolutionOnlyRead = { name : 'sec_only_read_spaces_space1' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { siem : [ 'read' ] , } , spaces : [ 'space1' ] , } , ] , } , } ; export const securitySolutionOnlyReadSpace2 = { name : 'sec_only_read_spaces_space2' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { siem : [ 'read' ] , } , spaces : [ 'space2' ] , } , ] , } , } ; export const observabilityOnlyAll = { name : 'obs_only_all_spaces_space1' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'all' ] , } , spaces : [ 'space1' ] , } , ] , } , } ; export const observabilityOnlyAllSpace2 = { name : 'obs_only_all_spaces_space2' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'all' ] , } , spaces : [ 'space2' ] , } , ] , } , } ; export const observabilityOnlyRead = { name : 'obs_only_read_spaces_space1' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'read' ] , } , spaces : [ 'space1' ] , } , ] , } , } ; export const observabilityOnlyReadSpace2 = { name : 'obs_only_read_spaces_space2' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'read' ] , } , spaces : [ 'space2' ] , } , ] , } , } ; /**
 * These roles have access to all spaces.
 */ export const securitySolutionOnlyAllSpacesAll = { name : 'sec_only_all_spaces_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { siem : [ 'all' ] , } , spaces : [ '*' ] , } , ] , } , } ; export const securitySolutionOnlyReadSpacesAll = { name : 'sec_only_read_spaces_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { siem : [ 'read' ] , } , spaces : [ '*' ] , } , ] , } , } ; export const observabilityOnlyAllSpacesAll = { name : 'obs_only_all_spaces_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'all' ] , } , spaces : [ '*' ] , } , ] , } , } ; export const observabilityOnlyReadSpacesAll = { name : 'obs_only_read_all_spaces_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'read' ] , } , spaces : [ '*' ] , } , ] , } , } ; export const roles = [ noKibanaPrivileges , globalRead , securitySolutionOnlyAll , securitySolutionOnlyRead , observabilityOnlyAll , observabilityOnlyRead , observabilityOnlyReadSpacesAll , ] ; /**
 * These roles are only to be used in the 'trial' tests
 * since they rely on subfeature privileges which are a gold licencse feature
 * maybe put these roles into a separate roles file like "trial_roles"?
 */ export const observabilityMinReadAlertsRead = { name : 'obs_only_alerts_read' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'minimal_read' , 'alerts_read' ] , ruleRegistry : [ 'all' ] , actions : [ 'read' ] , builtInAlerts : [ 'all' ] , alerting : [ 'all' ] , } , spaces : [ 'space1' ] , } , ] , } , } ; export const observabilityMinReadAlertsReadSpacesAll = { name : 'obs_minimal_read_alerts_read_spaces_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'minimal_read' , 'alerts_read' ] , } , spaces : [ '*' ] , } , ] , } , } ; export const observabilityMinimalRead = { name : 'obs_minimal_read' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'minimal_read' ] , } , spaces : [ 'space1' ] , } , ] , } , } ; export const observabilityMinimalReadSpacesAll = { name : 'obs_minimal_read_spaces_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'minimal_read' ] , } , spaces : [ '*' ] , } , ] , } , } ; /**
 * ****************************************
 * These are used for testing update alerts privileges
 * ****************************************
 * ****************************************
 * ****************************************
 * ****************************************
 * ****************************************
 * ****************************************
 * ****************************************
 * ****************************************
 */ export const observabilityMinReadAlertsAll = { name : 'obs_only_alerts_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'minimal_read' , 'alerts_all' ] , } , spaces : [ 'space1' ] , } , ] , } , } ; export const observabilityMinReadAlertsAllSpacesAll = { name : 'obs_minimal_read_alerts_all_spaces_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'minimal_read' , 'alerts_all' ] , } , spaces : [ '*' ] , } , ] , } , } ; export const observabilityMinimalAll = { name : 'obs_minimal_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'minimal_all' ] , } , spaces : [ 'space1' ] , } , ] , } , } ; export const observabilityMinimalAllSpacesAll = { name : 'obs_minimal_all_spaces_all' , privileges : { elasticsearch : { indices : [ ] , } , kibana : [ { feature : { apm : [ 'minimal_all' ] , } , spaces : [ '*' ] , } , ] , } , } ; export const allRoles = [ noKibanaPrivileges , globalRead , securitySolutionOnlyAll , securitySolutionOnlyRead , observabilityOnlyAll , observabilityOnlyRead , securitySolutionOnlyAllSpacesAll , securitySolutionOnlyReadSpacesAll , observabilityOnlyAllSpacesAll , observabilityOnlyReadSpacesAll , observabilityMinReadAlertsRead , observabilityMinReadAlertsReadSpacesAll , observabilityMinimalRead , observabilityMinimalReadSpacesAll , observabilityMinReadAlertsAll , observabilityMinReadAlertsAllSpacesAll , observabilityMinimalAll , observabilityMinimalAllSpacesAll , securitySolutionOnlyAllSpace2 , securitySolutionOnlyReadSpace2 , observabilityOnlyAllSpace2 , observabilityOnlyReadSpace2 , ] ;