Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ users to have different roles assigned to them for specific databases. This
feature enables proper tenant isolation and fine-grained access control in
multi-tenant environments.

<Callout type="warning">

User-role mappings are simple maps located in the user. Deleting or renaming the database will not update this information. The admin needs to make sure the correct access is maintained at all times.

</Callout>

## Privileges with multiple roles

When a user has multiple roles, their privileges are combined according to the
Expand Down Expand Up @@ -215,7 +221,7 @@ specification, even in multi-tenant environments. It will show all roles
assigned to the user across all databases.

```cypher
-- Show all roles for a user (works in all environments)
-- Show all roles for a user (works in all environments)
SHOW ROLE FOR user_name;
SHOW ROLES FOR user_name;
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ SHOW ROLE FOR user_name ON CURRENT;
SHOW ROLE FOR user_name ON DATABASE database_name;
```

<Callout type="warning">

User-role mappings are simple maps located in the user. Deleting or renaming the database will not update this information. The admin needs to make sure the correct access is maintained at all times.

</Callout>

These commands return the aggregated roles for the user in the specified
database context. The `ON MAIN` option shows roles for the user's main database,
`ON CURRENT` shows roles for whatever database is currently active, and `ON
Expand Down
6 changes: 6 additions & 0 deletions pages/database-management/multi-tenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ unified source of truth. A single user can access multiple databases with a
global set of privileges, but currently, per-database privileges cannot be
granted.

<Callout type="warning">

User-role mappings are simple maps located in the user. Deleting or renaming the database will not update this information. The admin needs to make sure the correct access is maintained at all times.

</Callout>

Access to all databases can be granted or revoked using wildcards:
`GRANT DATABASE * TO user;`, `DENY DATABASE * TO user;` or
`REVOKE DATABASE * FROM user;`.
Expand Down