6. Grant#

6.1. Synopsis#

GRANT <privileges>

  ON { <entries> | <find_expression> }

  TO <grantees>

find_expression ::=
  FIND ( { <type_expression> | <tag_expression> | NOT <tag_expression> } [ AND ... ] )

tag_expression ::=
  TAG = 'tag_name'

type_expression ::=
  TYPE = { BLOB | DEQUE | HSET | INT | INTEGER | STREAM | TAG | TS }

6.2. Description#

GRANT will grant the specified privileges on the entries listed to the grantees listed.

6.3. Parameters#

privileges

The name of the entries for which the privileges should be granted. The privileges will be merged with previously specified privileges for the entry. If no previous privileges are specified for that entry, then the default privileges of the user will be merged with the granted privileges.

entries

The name of the entries to modify privileges.

find_expression

When your tables are tagged, you can use inline key/value lookups to perform your query over multiple tables. To match all tables that have the tag “stocks”, you can use FIND(tag='stocks' AND type=ts).

grantees

The list of grantees to grant privileges to.

6.4. Examples#

In the following examples, Alice and Bob have the SELECT default privileges.

Grant to the user Alice the SELECT privilege on a table:

GRANT SELECT ON table1 TO Alice

Since Alice had already the SELECT default privilege, Alice will not gain any additional privilege on table1.

Grant to the user Bob the INSERT privilege on two tables:

GRANT INSERT ON table1, table2 TO Bob

Since Bob had the SELECT default privilege, Bob can now SELECT and INSERT on table1 and table2.