> ## 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.

# grant_role

[Source](https://github.com/kineticadb/kinetica-api-rust/blob/master/crates/gpudb-api/src/generated/grant_role.rs#L22-L29)
pub async fn [grant\_role](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/grant-role.md#method.grant_role)( \&self, role: [String](https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html), member: [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)\<[GrantRoleResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.GrantRoleResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

Grant membership in a role to a user or roleGrants membership in a role to a user or role.

##### Arguments

<ul>
  <li>`role` - Name of the role in which membership will be granted. Must be an existing role.</li>
  <li>`member` - Name of the user or role that will be granted membership in `role`. Must be an existing user or role.</li>
</ul>

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

Grant membership in a role to a user or roleGrants membership in a role to a user or role.

##### Arguments

<ul>
  <li>`role` - Name of the role in which membership will be granted. Must be an existing role.</li>
  <li>`member` - Name of the user or role that will be granted membership in `role`. Must be an existing user or role.</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/grant_role.rs#L64-L75)
pub async fn [grant\_role\_raw](https://docs.kinetica.com/content/api/rust/gpudb/struct.Kinetica/grant-role.md#method.grant_role_raw)( \&self, request: &[GrantRoleRequest](https://docs.kinetica.com/content/api/rust/generated/api/struct.GrantRoleRequest.md), ) -> [Result](https://doc.rust-lang.org/1.98.1/core/result/enum.Result.html)\<[GrantRoleResponse](https://docs.kinetica.com/content/api/rust/generated/api/struct.GrantRoleResponse.md), [KineticaError](https://docs.kinetica.com/content/api/rust/errors/enum.KineticaError.md)>

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

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

Sends a pre-built [`GrantRoleRequest`](https://docs.kinetica.com/content/api/rust/generated/api/struct.GrantRoleRequest) 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.