Override role privileges
PUT/metalakes/:metalake/permissions/roles/:role
Replaces all securable objects and privileges of a role with the given list and returns the updated role. Securable objects of the role that are not in the list are removed from it.
Sign in with a bearer token or a local user's password; see Authentication.
Request
Path Parameters
The name of the metalake
The name of the role
- application/json
Body
Array [
Array [
]
]
overrides
object[]
A list of securable objects to update
The full name of the securable object
Possible values: [metalake, catalog, schema, fileset, table, view, topic, model, tag, policy, job_template, function]
The type of the securable object. Only types that at least one privilege can be bound to are accepted, and each privilege in privileges must support the type. Responses return the value in lowercase; requests accept any case.
privileges
object[]
A list of privileges
Possible values: [create_catalog, use_catalog, create_schema, use_schema, create_table, modify_table, select_table, create_fileset, write_fileset, read_fileset, create_topic, produce_topic, consume_topic, manage_users, manage_groups, create_role, manage_grants, register_model, create_model, link_model_version, create_model_version, use_model, create_tag, apply_tag, create_policy, apply_policy, register_job_template, use_job_template, run_job, create_view, select_view, register_function, execute_function, modify_function, use_secrets, include_credential_secrets]
The name of the privilege, one of the values of Privilege.Name. Responses return the name in lowercase; requests accept any case. create_model and create_model_version are deprecated: the server still accepts them as aliases of register_model and link_model_version, and new requests should use the new names.
Possible values: [allow, deny]
The condition of the privilege, allow or deny. Responses return the value in lowercase; requests accept any case.
Responses
- 200
- 400
- 404
- 5xx
The role, with its securable objects and privileges replaced by the given list.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- RoleResponse
Schema
Array [
Array [
]
]
Possible values: [0]
Status code of the response
role
object
The name of the role
properties
object
nullable
A map of properties for the role
securableObjects
object[]
A list of securable objects
The full name of the securable object
Possible values: [metalake, catalog, schema, fileset, table, view, topic, model, tag, policy, job_template, function]
The type of the securable object. Only types that at least one privilege can be bound to are accepted, and each privilege in privileges must support the type. Responses return the value in lowercase; requests accept any case.
privileges
object[]
A list of privileges
Possible values: [create_catalog, use_catalog, create_schema, use_schema, create_table, modify_table, select_table, create_fileset, write_fileset, read_fileset, create_topic, produce_topic, consume_topic, manage_users, manage_groups, create_role, manage_grants, register_model, create_model, link_model_version, create_model_version, use_model, create_tag, apply_tag, create_policy, apply_policy, register_job_template, use_job_template, run_job, create_view, select_view, register_function, execute_function, modify_function, use_secrets, include_credential_secrets]
The name of the privilege, one of the values of Privilege.Name. Responses return the name in lowercase; requests accept any case. create_model and create_model_version are deprecated: the server still accepts them as aliases of register_model and link_model_version, and new requests should use the new names.
Possible values: [allow, deny]
The condition of the privilege, allow or deny. Responses return the value in lowercase; requests accept any case.
audit
object
Audit information for a Gravitino resource.
The user who created the resource
The time the resource was created
The user who last modified the resource
The time the resource was last modified
{
"code": 0,
"role": {
"name": "string",
"properties": {},
"securableObjects": [
{
"fullName": "string",
"type": "metalake",
"privileges": [
{
"name": "create_catalog",
"condition": "allow"
}
]
}
],
"audit": {
"creator": "string",
"createTime": "2024-07-29T15:51:28.071Z",
"lastModifier": "string",
"lastModifiedTime": "2024-07-29T15:51:28.071Z"
}
}
}
{
"code": 0,
"role": {
"name": "role1",
"properties": {
"k1": "v1"
},
"securableObjects": [
{
"fullName": "catalog1.schema1.table1",
"type": "table",
"privileges": [
{
"name": "select_table",
"condition": "allow"
}
]
}
]
}
}
A privilege is not supported by the object's type, or the same privilege is listed twice with different conditions.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- IllegalPrivilegeException
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
Deprecated diagnostic stack trace. Enterprise omits it by default because it can expose internal implementation details. Operators can opt in for controlled diagnostics with gravitino.server.webserver.includeErrorStackTrace=true. See OWASP REST Security: Error handling and CWE-209.
{
"code": 1002,
"type": "string",
"message": "string"
}
{
"code": 1001,
"type": "IllegalPrivilegeException",
"message": "Doesn't support duplicated privilege name SELECT_TABLE with different condition",
"stack": [
"org.apache.gravitino.exceptions.IllegalPrivilegeException: Doesn't support duplicated privilege name SELECT_TABLE with different condition",
"..."
]
}
The metalake, the role or one of the securable objects does not exist.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- NoSuchMetalakeException
- NoSuchRoleException
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
Deprecated diagnostic stack trace. Enterprise omits it by default because it can expose internal implementation details. Operators can opt in for controlled diagnostics with gravitino.server.webserver.includeErrorStackTrace=true. See OWASP REST Security: Error handling and CWE-209.
{
"code": 1002,
"type": "string",
"message": "string"
}
{
"code": 1003,
"type": "NoSuchMetalakeException",
"message": "Failed to operate metalake(s) [test] operation [LOAD], reason [NoSuchMetalakeException]",
"stack": [
"org.apache.gravitino.exceptions.NoSuchMetalakeException: Metalake test does not exist",
"..."
]
}
{
"code": 1003,
"type": "NoSuchRoleException",
"message": "Role does not exist",
"stack": [
"org.apache.gravitino.exceptions.NoSuchRoleException: Role does not exist",
"..."
]
}
The server hit an internal error that the client usually cannot fix by changing the request.
- application/vnd.gravitino.v1+json
- Schema
- Example (from schema)
- Example
Schema
Possible values: >= 1000 and <= 1100
HTTP response code
Internal type definition of the error
A human-readable message
Deprecated diagnostic stack trace. Enterprise omits it by default because it can expose internal implementation details. Operators can opt in for controlled diagnostics with gravitino.server.webserver.includeErrorStackTrace=true. See OWASP REST Security: Error handling and CWE-209.
{
"code": 1002,
"type": "string",
"message": "string"
}
{
"code": 1002,
"type": "RuntimeException",
"message": "Internal Server Error",
"stack": [
"java.lang.RuntimeException: Internal Server Error"
]
}