@@ -6,14 +6,14 @@ box.schema.user.grant()
6
6
7
7
.. module :: box.schema
8
8
9
- .. function :: box.schema.user.grant(user-name , privileges, object-type, object-name[, {options} ])
10
- box.schema.user.grant(user-name , privileges, 'universe'[, nil, {options} ])
11
- box.schema.user.grant(user-name , role-name[, nil, nil, {options} ])
9
+ .. function :: box.schema.user.grant(username , privileges, object-type, object-name[, {options} ])
10
+ box.schema.user.grant(username , privileges, 'universe'[, nil, {options} ])
11
+ box.schema.user.grant(username , role-name[, nil, nil, {options} ])
12
12
13
13
Grant :ref: `privileges <authentication-owners_privileges >` to a user or
14
14
to another role.
15
15
16
- :param string user-name : the name of a user to grant privileges to
16
+ :param string username : the name of a user to grant privileges to
17
17
:param string privileges: one or more privileges to grant to the user (for example, `read ` or `read,write `)
18
18
:param string object-type: a database object type to grant privileges to (for example, `space `, `role `, or `function `)
19
19
:param string object-name: the name of a database object to grant privileges to
@@ -30,8 +30,8 @@ box.schema.user.grant()
30
30
``role-name `` (see section :ref: `Roles <authentication-roles >`).
31
31
32
32
**Variation: ** instead of
33
- :samp: `box.schema.user.grant('{ user-name } ','usage,session','universe',nil, ` :code: `{if_not_exists=true}) `
34
- say :samp: `box.schema.user.enable('{ user-name } ') `.
33
+ :samp: `box.schema.user.grant('{ username } ','usage,session','universe',nil, ` :code: `{if_not_exists=true}) `
34
+ say :samp: `box.schema.user.enable('{ username } ') `.
35
35
36
36
The possible options are:
37
37
@@ -41,11 +41,10 @@ box.schema.user.grant()
41
41
42
42
**Example: **
43
43
44
- .. code-block :: lua
44
+ .. literalinclude :: /code_snippets/test/access_control/grant_user_privileges_test.lua
45
+ :language: lua
46
+ :start-after: Grant privileges to the specified user
47
+ :end-before: End: Grant privileges to the specified user
48
+ :dedent:
45
49
46
- box.schema.user.grant('Lena', 'read', 'space', 'tester')
47
- box.schema.user.grant('Lena', 'execute', 'function', 'f')
48
- box.schema.user.grant('Lena', 'read,write', 'universe')
49
- box.schema.user.grant('Lena', 'Accountant')
50
- box.schema.user.grant('Lena', 'read,write,execute', 'universe')
51
- box.schema.user.grant('X', 'read', 'universe', nil, {if_not_exists=true})
50
+ See also: :ref: `access_control_users `.
0 commit comments