Skip to content

Docs for DEFAULT LANGUAGE #2153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: cypher-25
Choose a base branch
from
1 change: 1 addition & 0 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
*** xref:database-administration/composite-databases/concepts.adoc[]
*** xref:database-administration/composite-databases/create-composite-databases.adoc[]
*** xref:database-administration/composite-databases/list-composite-databases.adoc[]
*** xref:database-administration/composite-databases/alter-composite-databases.adoc[]
*** xref:database-administration/composite-databases/delete-composite-databases.adoc[]
*** xref:database-administration/composite-databases/querying-composite-databases.adoc[]
*** xref:database-administration/composite-databases/sharding-with-copy.adoc[]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
751 changes: 1 addition & 750 deletions modules/ROOT/images/privileges_hierarchy_dbms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ CREATE ROLE databaseDropper IF NOT EXISTS;
CREATE ROLE compositeDatabaseDropper IF NOT EXISTS;
CREATE ROLE databaseModifier IF NOT EXISTS;
CREATE ROLE accessModifier IF NOT EXISTS;
CREATE ROLE languageModifier IF NOT EXISTS;
CREATE ROLE compositeDatabaseModifier IF NOT EXISTS;
CREATE ROLE compositeDatabaseManager IF NOT EXISTS;
CREATE ROLE databaseManager IF NOT EXISTS;
CREATE ROLE aliasAdder IF NOT EXISTS;
Expand Down Expand Up @@ -67,9 +69,9 @@ All DBMS privileges are relevant system-wide.
Like user management, they do not belong to one specific database or graph.
For more details on the differences between graphs, databases, and the DBMS, refer to link:{neo4j-docs-base-uri}/cypher-manual/current/introduction/cypher_neo4j/[Cypher Manual -> Cypher and Neo4j].

image::privileges_grant_and_deny_syntax_dbms_privileges.svg[title="Syntax of GRANT and DENY DBMS Privileges"]
image::privileges_grant_and_deny_syntax_dbms_privileges.svg[width="800", title="Syntax of GRANT and DENY DBMS Privileges"]

image::privileges_hierarchy_dbms.svg[title="DBMS privileges hierarchy"]
image::privileges_hierarchy_dbms.svg[width="800", title="DBMS privileges hierarchy"]

The xref:authentication-authorization/built-in-roles.adoc#access-control-built-in-roles-admin[`admin` role] has a number of built-in privileges.
These include:
Expand Down Expand Up @@ -864,26 +866,32 @@ For more details about the syntax descriptions, see xref:database-administration
GRANT [IMMUTABLE] CREATE DATABASE
ON DBMS
TO role[, ...]
| Enables the specified roles to create new standard databases and aliases.
| Enables the specified roles to create new standard databases.

| [source, syntax, role=noheader]
GRANT [IMMUTABLE] DROP DATABASE
ON DBMS
TO role[, ...]
| Enables the specified roles to delete standard databases and aliases.
| Enables the specified roles to delete standard databases.

| [source, syntax, role=noheader]
GRANT [IMMUTABLE] ALTER DATABASE
ON DBMS
TO role[, ...]
| Enables the specified roles to modify standard databases and aliases.
| Enables the specified roles to modify standard databases.

| [source, syntax, role=noheader]
GRANT [IMMUTABLE] SET DATABASE ACCESS
ON DBMS
TO role[, ...]
| Enables the specified roles to modify access to standard databases.

| [source, syntax, role=noheader]
GRANT [IMMUTABLE] SET DATABASE DEFAULT LANGUAGE
ON DBMS
TO role[, ...]
| Enables the specified roles to set the default query language on a standard database.

| [source, syntax, role=noheader]
GRANT CREATE COMPOSITE DATABASE
ON DBMS
Expand All @@ -896,30 +904,36 @@ GRANT DROP COMPOSITE DATABASE
TO role[, ...]
| Enables the specified roles to delete composite databases.

| [source, syntax, role=noheader]
GRANT ALTER COMPOSITE DATABASE
ON DBMS
TO role[, ...]
| Enables the specified roles to modify composite databases.

| [source, syntax, role=noheader]
GRANT COMPOSITE DATABASE MANAGEMENT
ON DBMS
TO role[, ...]
| Enables the specified roles to create and delete composite databases.
| Enables the specified roles to create, delete or modify composite databases.

| [source, syntax, role=noheader]
GRANT [IMMUTABLE] DATABASE MANAGEMENT
ON DBMS
TO role[, ...]
| Enables the specified roles to create, delete, and modify databases and aliases.
| Enables the specified roles to create, delete, and modify databases.

|===


The ability to create standard databases and aliases can be granted via the `CREATE DATABASE` privilege.
The ability to create standard databases can be granted via the `CREATE DATABASE` privilege.
See an example:

[source, cypher, role=noplay]
----
GRANT CREATE DATABASE ON DBMS TO databaseAdder
----

The resulting role has privileges that only allow creating standard databases and aliases.
The resulting role has privileges that only allow creating standard databases.
List all privileges for the role `databaseAdder` as commands by using the following query:

[source, cypher, role=noplay]
Expand Down Expand Up @@ -959,15 +973,15 @@ SHOW ROLE compositeDatabaseAdder PRIVILEGES AS COMMANDS
a|Rows: 1
|===

The ability to delete standard databases and aliases can be granted via the `DROP DATABASE` privilege.
The ability to delete standard databases can be granted via the `DROP DATABASE` privilege.
See an example:

[source, cypher, role=noplay]
----
GRANT DROP DATABASE ON DBMS TO databaseDropper
----

The resulting role has privileges that only allow deleting standard databases and aliases.
The resulting role has privileges that only allow deleting standard databases.
List all privileges for the role `databaseDropper` as commands by using the following query:

[source, cypher, role=noplay]
Expand Down Expand Up @@ -1007,15 +1021,15 @@ SHOW ROLE compositeDatabaseDropper PRIVILEGES AS COMMANDS
a|Rows: 1
|===

The ability to modify standard databases and aliases can be granted via the `ALTER DATABASE` privilege.
The ability to modify standard databases can be granted via the `ALTER DATABASE` privilege.
See an example:

[source, cypher, role=noplay]
----
GRANT ALTER DATABASE ON DBMS TO databaseModifier
----

The resulting role has privileges that only allow modifying standard databases and aliases.
The resulting role has privileges that only allow modifying standard databases.
List all privileges for the role `databaseModifier` as commands by using the following query:

[source, cypher, role=noplay]
Expand Down Expand Up @@ -1055,6 +1069,54 @@ SHOW ROLE accessModifier PRIVILEGES AS COMMANDS
a|Rows: 1
|===

The ability to modify the default language to standard databases can be granted via the `SET DATABASE DEFAULT LANGUAGE` privilege.
See an example:

[source, cypher, role=noplay]
----
GRANT SET DATABASE DEFAULT LANGUAGE ON DBMS TO languageModifier
----

The resulting role has privileges that only allow modifying default language to standard databases.
List all privileges for the role `languageModifier` as commands by using the following query:

[source, cypher, role=noplay]
----
SHOW ROLE languageModifier PRIVILEGES AS COMMANDS
----

.Result
[options="header,footer", width="100%", cols="m"]
|===
|command
|"GRANT SET DATABASE DEFAULT LANGUAGE ON DBMS TO `languageModifier`"
a|Rows: 1
|===

The ability to modify composite databases can be granted via the `ALTER COMPOSITE DATABASE` privilege.
See an example:

[source, cypher, role=noplay]
----
GRANT ALTER COMPOSITE DATABASE ON DBMS TO compositeDatabaseModifier
----

The resulting role has privileges that only allow modifying composite databases.
List all privileges for the role `compositeDatabaseModifier` as commands by using the following query:

[source, cypher, role=noplay]
----
SHOW ROLE compositeDatabaseModifier PRIVILEGES AS COMMANDS
----

.Result
[options="header,footer", width="100%", cols="m"]
|===
|command
|"GRANT ALTER COMPOSITE DATABASE ON DBMS TO `compositeDatabaseModifier`"
a|Rows: 1
|===

The ability to create and delete composite databases can be granted via the `COMPOSITE DATABASE MANAGEMENT` privilege.
See an example:

Expand All @@ -1079,15 +1141,15 @@ SHOW ROLE compositeDatabaseManager PRIVILEGES AS COMMANDS
a|Rows: 1
|===

The ability to create, delete, and modify databases and aliases can be granted via the `DATABASE MANAGEMENT` privilege.
The ability to create, delete, and modify databases can be granted via the `DATABASE MANAGEMENT` privilege.
See an example:

[source, cypher, role=noplay]
----
GRANT DATABASE MANAGEMENT ON DBMS TO databaseManager
----

The resulting role has all privileges to manage standard and composite databases as well as aliases.
The resulting role has all privileges to manage standard and composite databases.
List all privileges for the role `databaseManager` as commands by using the following query:

[source, cypher, role=noplay]
Expand All @@ -1108,7 +1170,6 @@ a|Rows: 1

The DBMS privileges for alias management can be assigned by using Cypher administrative commands and can be applied to both local and remote aliases.
They can be granted, denied and revoked like other privileges.
It is also possible to manage aliases with <<access-control-dbms-administration-database-management, database management commands>>.

[NOTE]
====
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ CREATE DATABASE `perennial-flowers`;
----
////

Aliases in composite databases cannot be assigned default languages, they will always get the default from the composite database.

[[manage-aliases-composite-databases-list]]
== List database aliases in composite databases
Expand Down Expand Up @@ -152,14 +153,14 @@ SHOW ALIASES FOR DATABASE YIELD *
.Result
[role="queryresult"]
----
+-----------------------------------------------------------------------------------------------------------------------------------+
| name | composite | database | location | url | user | driver | properties |
+-----------------------------------------------------------------------------------------------------------------------------------+
| "garden.flowers" | "garden" | "perennial-flowers" | "local" | NULL | NULL | NULL | {perennial: TRUE} |
| "garden.trees" | "garden" | "updatedtrees" | "remote" | "neo4j+s://location:7687" | "alice" | {} | {treeversion: 2} |
| "library.romance" | "library" | "romance-books" | "remote" | "neo4j+s://location:7687" | "alice" | {} | {} |
| "library.sci-fi" | "library" | "sci-fi-books" | "local" | NULL | NULL | NULL | {} |
+-----------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| name | composite | database | location | url | user | driver | defaultLanguage | properties |
+-----------------------------------------------------------------------------------------------------------------------------------------------------+
| "garden.flowers" | "garden" | "perennial-flowers" | "local" | NULL | NULL | NULL | NULL | {perennial: TRUE} |
| "garden.trees" | "garden" | "updatedtrees" | "remote" | "neo4j+s://location:7687" | "alice" | {} | NULL | {treeversion: 2} |
| "library.romance" | "library" | "romance-books" | "remote" | "neo4j+s://location:7687" | "alice" | {} | NULL | {} |
| "library.sci-fi" | "library" | "sci-fi-books" | "local" | NULL | NULL | NULL | NULL | {} |
+-----------------------------------------------------------------------------------------------------------------------------------------------------+
----

[[delete-composite-database-alias]]
Expand Down
Loading