-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
71f92e8
commit 2475068
Showing
3 changed files
with
34 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,38 @@ | ||
# Collaborators | ||
|
||
For every database you connect in Mathesar, you can manage the access that your Mathesar users have to that database by adding them as collaborators. Each collaborator is associated with a PostgreSQL role that determines their permissions on the data. | ||
|
||
### _In Mathesar:_ Collaborators | ||
Only [Mathesar admin users](./users.md#admin) can manage collaborators. | ||
|
||
A "collaborator" is a Mathesar user who has access to a database through a specific PostgreSQL role. | ||
When you add a new database connection to Mathesar, your Mathesar user will automatically be added as a collaborator using the PostgreSQL role you specify at connection time. | ||
|
||
The Collaborators section allows you to add and remove collaborators and edit their corresponding PostgreSQL roles. | ||
## Adding a collaborator | ||
|
||
!!! tip "Keep in mind" | ||
!!! info "Prerequisites" | ||
Before you can add a new collaborator: | ||
|
||
- You'll only be able to choose roles that have been "configured" in the above section — roles for which Mathesar has passwords stored. | ||
- Your [database](./databases.md) must be connected already. | ||
- The [user](./users.md) must already exist in Mathesar. | ||
- The [role](./roles.md) must already exist in PostgreSQL. (If needed, uou can use Mathesar to [add new role](./roles.md#managing) before creating a collaborator.) | ||
|
||
- Removing a collaborator revokes that user's access to the database _but_: | ||
1. Navigate to the page for your connected database. | ||
1. Click on the **Database Settings** tab. | ||
1. Click on **Collaborators** in the left-hand menu. | ||
1. Click **Add Collaborator**. | ||
|
||
- If the user is a Mathesar [admin](./users.md#admin), they'll be able to gain access again. | ||
- The user will still remain in Mathesar, potentially with access to other Databases. | ||
- The role (and its corresponding password) will still remain configured in Mathesar. | ||
- The role will still remain on the PostgreSQL server. | ||
## Removing a collaborator | ||
|
||
Removing a collaborator revokes that user's access to the database _but_: | ||
|
||
- If the user is a Mathesar [admin](./users.md#admin), they'll be able to gain access again by adding their user back as a collaborator. | ||
- The user will still remain in Mathesar, potentially with access to other Databases. | ||
- The role (and its corresponding password) will still remain configured in Mathesar. | ||
- The role will still remain on the PostgreSQL server. | ||
|
||
|
||
### _In Mathesar:_ Role Configuration | ||
|
||
Use this section to manage the credentials (i.e. passwords) for roles that you'd like to assign to collaborators within Mathesar. Mathesar will display all [LOGIN roles](https://www.postgresql.org/docs/current/role-attributes.html#ROLE-ATTRIBUTES) that exist on the server. | ||
|
||
- Click **Configure in Mathesar** to store the role's password in Mathesar and allow the role to be associated with collaborators. | ||
|
||
- Click **Configure Password** to update the password of an already configured role. | ||
|
||
- Click **Remove** to remove Mathesar's stored password for a role. The role will remain on the server. | ||
|
||
|
||
## Users vs Roles vs Collaborators | ||
|
||
- A **[user](./users.md)** is a Mathesar construct. Each Mathesar installation has multiple users. | ||
- A **role** is a PostgreSQL construct. (See [PostgreSQL docs](https://www.postgresql.org/docs/current/user-manag.html)). Each PostgreSQL server has multiple roles and multiple databases. | ||
|
||
!!! caution "Why this distinction is important" | ||
Outside of Mathesar, it's not uncommon for people to say _user_ when referring to a PostgreSQL _role_. However, within the context of Mathesar users and roles are different things! Our documentation maintains this distinction pedantically. | ||
|
||
How users and roles work together: | ||
|
||
- To access a database, each Mathesar user must be assigned a PostgreSQL role to be used for that database. | ||
- The user's permissions on actual data (i.e. _not_ Mathesar [metadata](./metadata.md)) are determined by the corresponding role's permissions within PostgreSQL. | ||
|
||
!!! info "Admin doesn't matter here" | ||
The user's "admin" status with Mathesar _has no effect_ on the user's ability to do things with the _data_ in a database! The admin status only affects higher-level operations like adding/removing databases, users, and collaborators. | ||
## Configuration patterns | ||
|
||
- You can configure separate Mathesar users to share the same PostgreSQL role if you like. This is a good option if you want those users to have the same permissions on the data. | ||
- Or you can use separate PostgreSQL roles for different users. This is necessary any time you want different users to have different permissions on the data. | ||
- You cannot configure one Mathesar user with two PostgreSQL role simultaneously — though you can save multiple PostgreSQL roles in Mathesar and manually switch between them if necessary. | ||
- You cannot configure one Mathesar user with two PostgreSQL role simultaneously — though you can save multiple PostgreSQL roles in Mathesar and manually switch between them if necessary. You won't even need to enter the role's password each time you switch, since it will be saved in Mathesar. | ||
|
||
See [Permissions](./permissions.md) for more information on managing roles. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters