Privileges are permissions that can be granted to database users. You can manage user permissions either via the console, the Scaleway APIs or SQL. Managed Database for PostgreSQL and MySQL provides a simplified and unified permission model through the API and the console to make things easier to manage and understand.
Each user has associated permissions that give them access to zero or more logical databases. These include:
- None: No access to the database
- Read: Allow users to read tables and fields in a database
- Write: Allow users to write content in databases.
- Admin: Read and write access to the data, and extended privileges depending on the database engine.
List user privileges for a database
List privileges of a user on a database. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as database_name and user_name.
path Parameters
regionThe region you want to target
instance_idUUID of the Database Instance.
query Parameters
order_byCriteria to use when ordering privileges listing.
pagepage_sizedatabase_nameName of the database.
user_nameName of the user.
List user privileges for a database › Responses
Privileges of a user in a database in a Database Instance.
total_countTotal count of privileges present on a database.
Set user privileges for a database
Set the privileges of a user on a database. You must define database_name, user_name and permission in the request body.
path Parameters
regionThe region you want to target
instance_idUUID of the Database Instance.
Set user privileges for a database › Request Body
database_nameName of the database.
user_nameName of the user.
permissionPermission to set (Read, Read/Write, All, Custom).
Set user privileges for a database › Responses
permissionPermission (Read, Read/Write, All, Custom).
database_nameName of the database.
user_nameName of the user.