Check user profile privileges
- POST also GET /_security/profile/_has_privileges
Determine whether the users associated with the specified user profile IDs have all the requested privileges.
NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual users and external applications should not call this API directly. Elastic reserves the right to change or remove this feature in future releases without prior notice.
- Cluster privileges:
read_security
Request
-
uidsstringrequired -
A list of profile IDs. The privileges are checked for associated users of the profiles.
-
privilegesPrivilegesCheckrequired -
An object containing all the privileges to be checked.
-
applicationApplicationPrivilegesCheck -
applicationstringrequired -
The name of the application.
-
privilegesstringrequired -
A list of the privileges that you want to check for the specified resources. It may be either application privilege names or the names of actions that are granted by those privileges
-
resourcesstringrequired -
A list of resource names against which the privileges should be checked.
-
clusterClusterPrivilege -
A list of the cluster privileges that you want to check.
-
Values:
allcancel_taskcreate_snapshotcross_cluster_replicationcross_cluster_searchdelegate_pkigrant_api_keymanagemanage_api_keymanage_autoscalingmanage_behavioral_analyticsmanage_ccrmanage_data_frame_transformsmanage_data_stream_global_retentionmanage_enrichmanage_ilmmanage_index_templatesmanage_inferencemanage_ingest_pipelinesmanage_logstash_pipelinesmanage_mlmanage_oidcmanage_own_api_keymanage_pipelinemanage_rollupmanage_samlmanage_search_applicationmanage_search_query_rulesmanage_search_synonymsmanage_securitymanage_service_accountmanage_slmmanage_tokenmanage_transformmanage_user_profilemanage_watchermonitormonitor_data_frame_transformsmonitor_data_stream_global_retentionmonitor_enrichmonitor_inferencemonitor_mlmonitor_rollupmonitor_snapshotmonitor_statsmonitor_text_structuremonitor_transformmonitor_watchernonepost_behavioral_analytics_eventread_ccrread_fleet_secretsread_ilmread_pipelineread_securityread_slmtransport_clientwrite_connector_secretswrite_fleet_secrets -
indexIndexPrivilegesCheck -
namesstring Indicesrequired -
A list of indices.
-
privilegesIndexPrivilegerequired -
A list of the privileges that you want to check for the specified indices.
-
Values:
allauto_configurecreatecreate_doccreate_indexcross_cluster_replicationcross_cluster_replication_internaldeletedelete_indexindexmaintenancemanagemanage_data_stream_lifecyclemanage_follow_indexmanage_ilmmanage_leader_indexmonitornonereadread_cross_clusterview_index_metadatawrite -
allow_restricted_indicesboolean -
This needs to be set to
true(default isfalse) if using wildcards or regexps for patterns that cover restricted indices. Implicitly, restricted indices do not match index patterns because restricted indices usually have limited privileges and including them in pattern tests would render most such tests false. If restricted indices are explicitly included in the names list, privileges will be checked against them regardless of the value ofallow_restricted_indices.
Response
-
has_privilege_uidsstringrequired -
The subset of the requested profile IDs of the users that have all the requested privileges.
-
errorsHasPrivilegesUserProfileErrors -
The subset of the requested profile IDs for which an error was encountered. It does not include the missing profile IDs or the profile IDs of the users that do not have all the requested privileges. This field is absent if empty.
-
countnumberrequired -
detailsmap string to ErrorCauserequired -
<string>ErrorCause -
typestringrequired -
The type of error
-
reasonstringnullable -
A human-readable explanation of the error, in English.
-
stack_tracestring -
The server stack trace. Present only if the
error_trace=trueparameter was sent with the request. -
caused_byErrorCause -
root_causeErrorCause -
suppressedErrorCause