interface FeaturesPrivileges { [ featureId ] : string [ ] ; } interface CustomRoleSpecificationElasticsearchIndices { names : string [ ] ; privileges : string [ ] ; } export interface RoleKibanaPrivilege { spaces : string [ ] ; base ? : string [ ] ; feature ? : FeaturesPrivileges ; } export interface CustomRoleSpecification { name : string ; elasticsearch ? : { cluster ? : string [ ] ; indices ? : CustomRoleSpecificationElasticsearchIndices [ ] ; } ; kibana ? : RoleKibanaPrivilege [ ] ; } interface ReservedRoleSpecification { name : string ; } export function isCustomRoleSpecification ( roleSpecification ) { const customRoleDefinition = roleSpecification as CustomRoleSpecification ; return ( customRoleDefinition . kibana !== undefined || customRoleDefinition . elasticsearch !== undefined ) ; } export interface User { username : string ; fullName : string ; password : string ; role ? : ReservedRoleSpecification | CustomRoleSpecification ; roles ? : Array < ReservedRoleSpecification | CustomRoleSpecification > ; } export interface Space { id : string ; name : string ; disabledFeatures : string [ ] | '*' ; }