-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] Fix assistant settings availability for non-superuser role #182322
Changes from all commits
d54982e
37d4136
9cbb124
6bdfa7c
845589c
6f72d06
38a4a33
a19ec28
95d84c4
445444f
a050ffd
c16cc20
be414d5
0867041
1c34370
bc56a95
f37afe6
9ccd510
296620c
b8df2e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ import { | |
import { schema } from '@kbn/config-schema'; | ||
import type { AIAssistantManagementSelectionConfig } from './config'; | ||
import type { | ||
AIAssistantManagementSelectionPluginServerDependenciesSetup, | ||
AIAssistantManagementSelectionPluginServerDependenciesStart, | ||
AIAssistantManagementSelectionPluginServerSetup, | ||
AIAssistantManagementSelectionPluginServerStart, | ||
} from './types'; | ||
|
@@ -27,7 +29,9 @@ export class AIAssistantManagementSelectionPlugin | |
implements | ||
Plugin< | ||
AIAssistantManagementSelectionPluginServerSetup, | ||
AIAssistantManagementSelectionPluginServerStart | ||
AIAssistantManagementSelectionPluginServerStart, | ||
AIAssistantManagementSelectionPluginServerDependenciesSetup, | ||
AIAssistantManagementSelectionPluginServerDependenciesStart | ||
> | ||
{ | ||
private readonly config: AIAssistantManagementSelectionConfig; | ||
|
@@ -36,7 +40,10 @@ export class AIAssistantManagementSelectionPlugin | |
this.config = initializerContext.config.get(); | ||
} | ||
|
||
public setup(core: CoreSetup) { | ||
public setup( | ||
core: CoreSetup, | ||
plugins: AIAssistantManagementSelectionPluginServerDependenciesSetup | ||
) { | ||
core.uiSettings.register({ | ||
[PREFERRED_AI_ASSISTANT_TYPE_SETTING_KEY]: { | ||
name: i18n.translate('aiAssistantManagementSelection.preferredAIAssistantTypeSettingName', { | ||
|
@@ -79,6 +86,66 @@ export class AIAssistantManagementSelectionPlugin | |
}, | ||
}); | ||
|
||
core.capabilities.registerProvider(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: forgot to comment on this one yesterday - I don't think we need this here - I believe it's only needed when the feature/plugin can be used with Elastic Stack security disabled which is unlikely to be the case for this plugin. |
||
return { | ||
management: { | ||
kibana: { | ||
aiAssistantManagementSelection: true, | ||
observabilityAiAssistantManagement: true, | ||
securityAiAssistantManagement: true, | ||
}, | ||
}, | ||
}; | ||
}); | ||
|
||
plugins.features?.registerKibanaFeature({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: I'm not sure if this plugin is enabled in Serverless, but if it's - should this feature be available in Serverless role management UI? If so, for which project types (Security, Search, Observability)? |
||
id: 'aiAssistantManagementSelection', | ||
name: i18n.translate('aiAssistantManagementSelection.featureRegistry.featureName', { | ||
defaultMessage: 'AI Assistant', | ||
}), | ||
order: 8600, | ||
app: [], | ||
category: DEFAULT_APP_CATEGORIES.management, | ||
management: { | ||
kibana: [ | ||
'aiAssistantManagementSelection', | ||
'securityAiAssistantManagement', | ||
'observabilityAiAssistantManagement', | ||
], | ||
}, | ||
minimumLicense: 'enterprise', | ||
privileges: { | ||
all: { | ||
management: { | ||
kibana: [ | ||
'aiAssistantManagementSelection', | ||
'securityAiAssistantManagement', | ||
'observabilityAiAssistantManagement', | ||
], | ||
}, | ||
savedObject: { | ||
all: [], | ||
read: [], | ||
}, | ||
ui: [], | ||
}, | ||
read: { | ||
management: { | ||
kibana: [ | ||
'aiAssistantManagementSelection', | ||
'securityAiAssistantManagement', | ||
'observabilityAiAssistantManagement', | ||
], | ||
}, | ||
savedObject: { | ||
all: [], | ||
read: [], | ||
}, | ||
ui: [], | ||
}, | ||
}, | ||
}); | ||
|
||
return {}; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: cannot we make
features
pluginrequired
?