|
1 | 1 | = Users
|
2 | 2 |
|
3 |
| -[placeholder] |
4 |
| -Managing users in TypeDB server. |
| 3 | +This section covers the management of users in TypeDB. |
| 4 | + |
| 5 | +== Managing users |
| 6 | + |
| 7 | +Like database management, all user management operations are administrative, meaning they are performed through the TypeDB Console or client |
| 8 | +drivers by a user _with administrative privileges_, rather than with TypeQL queries. |
| 9 | + |
| 10 | +After first boot, the only user is `admin`. Cloud users will be able to set a custom initial password for `admin` during the initial |
| 11 | +setup. In TypeDB CE, the default initial password for `admin` is `password`. |
| 12 | + |
| 13 | +The lifecycle of a user is managed through a few simple commands. An administrator can add a new user at any time using `user create |
| 14 | +<username> [<password>]` in the Console (you will be prompted for a password if it's not provided), or programmatically with |
| 15 | +driver.users.create("<username>", "<password>"). To view all users currently on the server, an administrator can use the `user list` |
| 16 | +command. If a user's access needs to be revoked, it can be done permanently with the `user delete <username>` command. |
| 17 | + |
| 18 | +A user can change their password using `user update-password <username> [<new-password>]` in the Console (once again, you will be prompted |
| 19 | +for a new password if it's not provided), or programmatically with `driver.users.updatePassword("<new-password>")`. |
| 20 | +An administrator can change any user's password with the same command. |
| 21 | + |
| 22 | +== Permissions |
| 23 | + |
| 24 | +TypeDB's permission model is comprised of two roles. The administrator role is currently exclusive to the user `admin` and has full |
| 25 | +administrative privileges, including the ability to manage users and databases. Any other user is considered a standard user and, by |
| 26 | +default, is granted read and write permissions for all databases on the server, but cannot perform administrative actions. This model |
| 27 | +simplifies permission management by focusing on user-level access rather than complex, object-level grants. |
| 28 | + |
| 29 | +For a secure deployment, it is crucial to follow best practices. In a CE deployment, it is recommended to change the default admin password |
| 30 | +immediately. Furthermore, instead of using the powerful admin account for your applications, you should create dedicated standard users for |
| 31 | +each application or service. This follows the principle of least privilege and ensures that your applications have the necessary database |
| 32 | +access without possessing unnecessary administrative rights. |
0 commit comments