Skip to main content

Privileges

Centia.io has a simple privilege system that enables the super-user to grant sub-users read or write privileges on tables. Sub-users can grant privileges on tables in their own schemas.

Set privileges for a user on a table

By default, a sub-user has none privilege on tables outside their own schema. Privileges can be set explicitly to none, read, or write.

  • none: The sub-user cannot run statements on the table.
  • read: The sub-user can run select statements on the table.
  • write: The sub-user can run select, insert, update, and delete statements on the table.
Setting a single privilege
PATCH https://api.centia.io/api/v4/schemas/rockhall/inductees/privileges HTTP/1.1
Content-Type: application/json
Authorization: Bearer abc123

{
"subuser": "alx",
"privilege": "write"
}
Setting multiple privileges
PATCH https://api.centia.io/api/v4/schemas/rockhall/inductees/privileges HTTP/1.1
Content-Type: application/json
Authorization: Bearer abc123

[
{
"subuser": "alx",
"privilege": "write"
},
{
"subuser": "slash",
"privilege": "write"
}
]

Get privileges

Request
GET https://api.centia.io/api/v4/schemas/rockhall/inductees/privileges HTTP/1.1
Accept: application/json; charset=utf-8
Authorization: Bearer abc123
Response
[
{
"subuser": "alx",
"privilege": "write"
},
{
"subuser": "slash",
"privilege": "write"
}
]