Add database users
Apps in the project connect as the owner user, which owns the database and can change anything in it. To give a tool or a person a login with less access, add a database user. For example, create a read-only user for a reporting tool, so that it cannot change data even if its credentials leak. You cannot remove the owner user.
Prerequisites
Section titled “Prerequisites”- Edit access to the project: the Admin or Member project role.
- A dedicated database.
Add a user
Section titled “Add a user”- Open the database.
- Go to Settings > Users.
- Select Add user.
- In Name, enter a name for the user.
- In Access, select Read only or Read and write.
- Select Add user.
- Copy the Password and Connection string.
- Select Done.
orchard db user create <dbId> reporting --access readThe command prints the password once. The --access flag accepts read or write. The default is read. This command needs a token with the deploy scope.
Usernames
Section titled “Usernames”A username must follow these rules:
- It has 2 to 41 characters.
- It starts with a lowercase letter.
- It contains only lowercase letters, digits, and underscores.
- It does not start with
pg_orcnpg_. - It is not the owner user or another reserved name.
List users
Section titled “List users”- Open the database.
- Go to Settings > Users.
orchard db user list <dbId>Remove a user
Section titled “Remove a user”Removing a user disconnects all sessions that use the login, and the login stops working.
- Open the database.
- Go to Settings > Users.
- On the user, select the delete icon.
- Select Remove user.
orchard db user rm <dbId> <name>Related resources
Section titled “Related resources”- Read replicas - Point a read-only user at a standby to keep reporting off the primary.
orchard db userreference - Review the user commands and their flags.