> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# has_role

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/has_role.rs#L22-L29)
pub async fn [has\_role](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/has-role.md#method.has_role)( \&self, principal: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), role: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[HasRoleResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Check if user has specified roleChecks if the specified user has the specified role.

##### Arguments

<ul>
  <li>`principal` - Name of the user for which role membership is being checked. Must be an existing user. If blank, will use the current user.</li>
  <li>`role` - Name of role to check for membership.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/has_role.rs#L43-L61)
pub async fn [has\_role\_with\_opts](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/has-role.md#method.has_role_with_opts)( \&self, principal: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), role: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), options: [HasRoleRequestOptions](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleRequestOptions.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[HasRoleResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Check if user has specified roleChecks if the specified user has the specified role.

##### Arguments

<ul>
  <li>`principal` - Name of the user for which role membership is being checked. Must be an existing user. If blank, will use the current user.</li>
  <li>`role` - Name of role to check for membership.</li>
  <li>`options` - The optional parameters; any left unset take the server’s defaults.</li>
</ul>

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/has_role.rs#L64-L75)
pub async fn [has\_role\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/has-role.md#method.has_role_raw)( \&self, request: &[HasRoleRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[HasRoleResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`HasRoleRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleRequest) to the `/has/role` endpoint.

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/has_role.rs#L79-L91)
pub async fn [has\_role\_from\_url](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/has-role.md#method.has_role_from_url)( \&self, url: &[str](https://doc.rust-lang.org/1.98.1/std/primitive.str.html), request: &[HasRoleRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[HasRoleResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Sends a pre-built [`HasRoleRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.HasRoleRequest) to a specific worker URL, bypassing HA head-node selection. Used for multi-head access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.