This chapter shows how to grant privilege to the user.
curl -u shiva:shiva -XPOST "localhost:8902/hippo/v1/_security/acl/{user_name}?pretty" -H 'Content-Type: application/json' -d'
{
"table_name": "book",
"database_name" : "default",
"privileges": ["all"]
}';
Result:
{
"acknowledged" : true
}
Parameter description:
Parameters | Description | Required |
---|---|---|
user_name | User to whom will be granted privileges | Yes |
table_name | Table to be granted privileges | No, grants privileges on database if not specified |
database_name | Database where the table is located | No, defaults to "default" database |
privileges | Privileges, including “create”, “access”, “all” | Yes |
Kindly note
If “table_name” is specified, it represents that the privileges will be granted to the user on this target table. If not, the privileges will be granted on database, thus the “database_name” must be specified.