Skip to content

Commit 32a1c25

Browse files
committed
Credentials: update per TW review - update reference
1 parent 0f48f28 commit 32a1c25

File tree

13 files changed

+82
-95
lines changed

13 files changed

+82
-95
lines changed

doc/reference/reference_lua/box_schema/role_create.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ box.schema.role.create()
2222

2323
**Example:**
2424

25-
.. code-block:: lua
25+
.. literalinclude:: /code_snippets/test/access_control/grant_roles_test.lua
26+
:language: lua
27+
:start-after: Create roles
28+
:end-before: End: Create roles
29+
:dedent:
2630

27-
box.schema.role.create('Accountant')
28-
box.schema.role.create('Accountant', {if_not_exists = false})
31+
See also: :ref:`access_control_roles`.

doc/reference/reference_lua/box_schema/role_drop.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ box.schema.role.drop()
1818

1919
**Example:**
2020

21-
.. code-block:: lua
21+
.. literalinclude:: /code_snippets/test/access_control/grant_roles_test.lua
22+
:language: lua
23+
:start-after: Dropping a role
24+
:end-before: End: Dropping a role
25+
:dedent:
2226

23-
box.schema.role.drop('Accountant')
27+
See also: :ref:`access_control_roles`.

doc/reference/reference_lua/box_schema/role_exists.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,4 @@ box.schema.role.exists()
1313
:param string role-name: the name of the role
1414
:rtype: bool
1515

16-
**Example:**
17-
18-
.. code-block:: lua
19-
20-
box.schema.role.exists('Accountant')
16+
See also: :ref:`access_control_roles_info`.

doc/reference/reference_lua/box_schema/role_grant.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ box.schema.role.grant()
3131

3232
**Example:**
3333

34-
.. code-block:: lua
34+
.. literalinclude:: /code_snippets/test/access_control/grant_roles_test.lua
35+
:language: lua
36+
:start-after: Grant read/write privileges to a role
37+
:end-before: Grant write privileges to a role
38+
:dedent:
3539

36-
box.schema.role.grant('Accountant', 'read', 'space', 'tester')
37-
box.schema.role.grant('Accountant', 'execute', 'function', 'f')
38-
box.schema.role.grant('Accountant', 'read,write', 'universe')
39-
box.schema.role.grant('public', 'Accountant')
40-
box.schema.role.grant('role1', 'role2', nil, nil, {if_not_exists=false})
40+
See also: :ref:`access_control_roles`.

doc/reference/reference_lua/box_schema/role_info.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,4 @@ box.schema.role.info()
1212

1313
:param string role-name: the name of the role.
1414

15-
**Example:**
16-
17-
.. code-block:: lua
18-
19-
box.schema.role.info('Accountant')
15+
See also: :ref:`access_control_roles_info`.

doc/reference/reference_lua/box_schema/role_revoke.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,4 @@ box.schema.role.revoke()
2525
**Variation:** instead of ``privilege, object-type, object-name`` say
2626
``role-name``.
2727

28-
**Example:**
29-
30-
.. code-block:: lua
31-
32-
box.schema.role.revoke('Accountant', 'read', 'space', 'tester')
33-
box.schema.role.revoke('Accountant', 'execute', 'function', 'f')
34-
box.schema.role.revoke('Accountant', 'read,write', 'universe')
35-
box.schema.role.revoke('public', 'Accountant')
28+
See also: :ref:`access_control_roles`.

doc/reference/reference_lua/box_schema/user_create.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ box.schema.user.create()
2121
* ``password`` (default = '') - string; the ``password`` = *password*
2222
specification is good because in a :ref:`URI <index-uri>`
2323
(Uniform Resource Identifier) it is usually illegal to include a
24-
user-name without a password.
24+
username without a password.
2525

2626
.. NOTE::
2727

@@ -34,8 +34,10 @@ box.schema.user.create()
3434

3535
**Examples:**
3636

37-
.. code-block:: lua
37+
.. literalinclude:: /code_snippets/test/access_control/grant_user_privileges_test.lua
38+
:language: lua
39+
:start-after: Create a user with a password
40+
:end-before: End: Create a user with a password
41+
:dedent:
3842

39-
box.schema.user.create('testuser')
40-
box.schema.user.create('testuser', {password = 'foobar'})
41-
box.schema.user.create('testuser', {if_not_exists = false})
43+
See also: :ref:`access_control_users`.

doc/reference/reference_lua/box_schema/user_drop.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ box.schema.user.drop()
66

77
.. module:: box.schema
88

9-
.. function:: box.schema.user.drop(user-name [, {options}])
9+
.. function:: box.schema.user.drop(username [, {options}])
1010

1111
Drop a user.
1212
For explanation of how Tarantool maintains user data, see
1313
section :ref:`Users <authentication-users>` and reference on
1414
:ref:`_user <box_space-user>` space.
1515

16-
:param string user-name: the name of the user
16+
:param string username: the name of the user
1717
:param table options: ``if_exists`` = ``true|false`` (default = ``false``) - boolean;
1818
``true`` means there should be no error if the user does not exist.
1919

2020
**Examples:**
2121

22-
.. code-block:: lua
22+
.. literalinclude:: /code_snippets/test/access_control/grant_user_privileges_test.lua
23+
:language: lua
24+
:start-after: Drop a user
25+
:end-before: End: Drop a user
26+
:dedent:
2327

24-
box.schema.user.drop('Lena')
25-
box.schema.user.drop('Lena',{if_exists=false})
28+
See also: :ref:`access_control_users`.

doc/reference/reference_lua/box_schema/user_exists.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,14 @@ box.schema.user.exists()
66

77
.. module:: box.schema
88

9-
.. function:: box.schema.user.exists(user-name)
9+
.. function:: box.schema.user.exists(username)
1010

1111
Return ``true`` if a user exists; return ``false`` if a user does not exist.
1212
For explanation of how Tarantool maintains user data, see
1313
section :ref:`Users <authentication-users>` and reference on
1414
:ref:`_user <box_space-user>` space.
1515

16-
:param string user-name: the name of the user
16+
:param string username: the name of the user
1717
:rtype: bool
1818

19-
**Example:**
20-
21-
.. code-block:: lua
22-
23-
box.schema.user.exists('Lena')
19+
See also: :ref:`access_control_user_info`.

doc/reference/reference_lua/box_schema/user_grant.rst

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ box.schema.user.grant()
66

77
.. module:: box.schema
88

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} ])
1212

1313
Grant :ref:`privileges <authentication-owners_privileges>` to a user or
1414
to another role.
1515

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
1717
:param string privileges: one or more privileges to grant to the user (for example, `read` or `read,write`)
1818
:param string object-type: a database object type to grant privileges to (for example, `space`, `role`, or `function`)
1919
:param string object-name: the name of a database object to grant privileges to
@@ -30,8 +30,8 @@ box.schema.user.grant()
3030
``role-name`` (see section :ref:`Roles <authentication-roles>`).
3131

3232
**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}')`.
3535

3636
The possible options are:
3737

@@ -41,11 +41,10 @@ box.schema.user.grant()
4141

4242
**Example:**
4343

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:
4549

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`.

doc/reference/reference_lua/box_schema/user_info.rst

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,14 @@ box.schema.user.info()
66

77
.. module:: box.schema
88

9-
.. function:: box.schema.user.info([user-name])
9+
.. function:: box.schema.user.info([username])
1010

1111
Return a description of a user's :ref:`privileges <authentication-owners_privileges>`.
1212

13-
:param string user-name: the name of the user.
14-
This is optional; if it is not
15-
supplied, then the information
16-
will be for the user who is
17-
currently logged in.
13+
:param string username: the name of the user.
14+
This is optional; if it is not
15+
supplied, then the information
16+
will be for the user who is
17+
currently logged in.
1818

19-
**Example:**
20-
21-
.. code-block:: tarantoolsession
22-
23-
tarantool> box.schema.user.info('admin')
24-
---
25-
- - - read,write,execute,session,usage,create,drop,alter,reference,trigger,insert,update,delete
26-
- universe
27-
-
28-
...
19+
See also: :ref:`access_control_user_info`.

doc/reference/reference_lua/box_schema/user_passwd.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,25 @@ box.schema.user.passwd()
66

77
.. module:: box.schema
88

9-
.. function:: box.schema.user.passwd([name,] new_password)
9+
.. function:: box.schema.user.passwd([username,] password)
1010

1111
Sets a password for a currently logged in or a specified user:
1212

13-
* A currently logged in user can change their password using
14-
``box.schema.user.passwd(new_password)``.
13+
* A currently logged-in user can change their password using
14+
``box.schema.user.passwd(password)``.
1515

1616
* An administrator can change the password of another user with
17-
``box.schema.user.passwd(name, new_password)``.
17+
``box.schema.user.passwd(username, password)``.
1818

19-
:param string user-name: name
20-
:param string password: new_password
19+
:param string username: a username
20+
:param string password: a new password
2121

2222
**Example:**
2323

24-
.. code-block:: lua
24+
.. literalinclude:: /code_snippets/test/access_control/grant_user_privileges_test.lua
25+
:language: lua
26+
:start-after: Set a password for the specified user
27+
:end-before: End: Set a password for the specified user
28+
:dedent:
2529

26-
box.schema.user.passwd('foobar')
27-
box.schema.user.passwd('testuser', 'foobar')
30+
See also: :ref:`access_control_users`.

doc/reference/reference_lua/box_schema/user_revoke.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ box.schema.user.revoke()
66

77
.. module:: box.schema
88

9-
.. function:: box.schema.user.revoke(user-name, privileges, object-type, object-name[, {options} ])
10-
box.schema.user.revoke(user-name, privileges, 'universe'[, nil, {options} ])
11-
box.schema.user.revoke(user-name, role-name[, nil, nil, {options} ])
9+
.. function:: box.schema.user.revoke(username, privileges, object-type, object-name[, {options} ])
10+
box.schema.user.revoke(username, privileges, 'universe'[, nil, {options} ])
11+
box.schema.user.revoke(username, role-name[, nil, nil, {options} ])
1212

1313
Revoke :ref:`privileges <authentication-owners_privileges>` from a user
1414
or from another role.
1515

16-
:param string user-name: the name of the user.
16+
:param string username: the name of the user.
1717
:param string privilege: 'read' or 'write' or 'execute' or 'create' or
1818
'alter' or 'drop' or a combination.
1919
:param string object-type: 'space' or 'function' or 'sequence'.
@@ -31,14 +31,15 @@ box.schema.user.revoke()
3131
``role-name`` (see section :ref:`Roles <authentication-roles>`).
3232

3333
**Variation:** instead of
34-
:samp:`box.schema.user.revoke('{user-name}','usage,session','universe',nil,` :code:`{if_exists=true})`
35-
say :samp:`box.schema.user.disable('{user-name}')`.
34+
:samp:`box.schema.user.revoke('{username}','usage,session','universe',nil,` :code:`{if_exists=true})`
35+
say :samp:`box.schema.user.disable('{username}')`.
3636

3737
**Example:**
3838

39-
.. code-block:: lua
39+
.. literalinclude:: /code_snippets/test/access_control/grant_user_privileges_test.lua
40+
:language: lua
41+
:start-after: Revoke space reading
42+
:end-before: End: Revoke space reading
43+
:dedent:
4044

41-
box.schema.user.revoke('Lena', 'read', 'space', 'tester')
42-
box.schema.user.revoke('Lena', 'execute', 'function', 'f')
43-
box.schema.user.revoke('Lena', 'read,write', 'universe')
44-
box.schema.user.revoke('Lena', 'Accountant')
45+
See also: :ref:`access_control_users`.

0 commit comments

Comments
 (0)