Skip to content

Commit 81ffdec

Browse files
committed
Adds box.schema.user.enable and box.schema.user.disable methods description to Submodule box.schema
2 new files ("user_enable.rst" and user_disable.rst") added to the box.schema submodule. Files describe methods that activate and deactivate users. References added to existing files ("box_schema.rst", "user_grant.rst", "user_revoke.rst" Fixes #5122
1 parent a99dacd commit 81ffdec

File tree

5 files changed

+67
-2
lines changed

5 files changed

+67
-2
lines changed

doc/reference/reference_lua/box_schema.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ Below is a list of all ``box.schema`` functions.
5353
* - :doc:`./box_schema/user_revoke`
5454
- Revoke privileges from a user or a role
5555

56+
* - :doc:`./box_schema/user_enable`
57+
- Activate previously deactivated user
58+
59+
* - :doc:`./box_schema/user_disable`
60+
- Deactivate user
61+
5662
* - :doc:`./box_schema/user_password`
5763
- Get a hash of a user's password
5864

@@ -105,6 +111,8 @@ Below is a list of all ``box.schema`` functions.
105111
box_schema/user_exists
106112
box_schema/user_grant
107113
box_schema/user_revoke
114+
box_schema/user_enable
115+
box_schema/user_disable
108116
box_schema/user_password
109117
box_schema/user_passwd
110118
box_schema/user_info
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. _box_schema-user_disable:
2+
3+
===============================================================================
4+
box.schema.user.enable()
5+
===============================================================================
6+
7+
.. module:: box.schema
8+
9+
.. function:: box.schema.user.disable(username)
10+
11+
Deactivate a user. If :samp:`'{username}'` does not exist, an error is returned.
12+
13+
:param string username: the name of a user to be deactivated
14+
15+
:return: (if success) ``---``
16+
17+
(if failure) ``error: 'User '{username}' doesn''t exist'``
18+
19+
**Example:**
20+
21+
.. code-block:: lua
22+
23+
box.schema.user.disable (username)
24+
25+
---
26+
27+
**Variation:** instead of :samp:`box.schema.user.disable('{username}')`, say
28+
:samp:`box.schema.user.revoke('{username}','usage,session','universe',nil,` :code:`{if_exists=true})`
29+
(see section :ref:`box.schema.user.revoke <box_schema-user_revoke>`).
30+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.. _box_schema-user_enable:
2+
3+
===============================================================================
4+
box.schema.user.enable()
5+
===============================================================================
6+
7+
.. module:: box.schema
8+
9+
.. function:: box.schema.user.enable(username)
10+
11+
Activate deactivated user. If :samp:`'{username}'` does not exist, it will be created. If :samp:`'{username}'` is already active, nothing changes.
12+
13+
:param string username: the name of a user to be activated
14+
15+
:return: ``---``
16+
17+
**Example:**
18+
19+
.. code-block:: lua
20+
21+
box.schema.user.enable (username)
22+
23+
---
24+
25+
**Variation:** instead of :samp:`box.schema.user.enable('{username}')`, say
26+
:samp:`box.schema.user.grant('{username}','usage,session','universe',nil,` :code:`{if_not_exists=true})`
27+
(see section :ref:`box.schema.user.grant <box_schema-user_grant>`).

doc/reference/reference_lua/box_schema/user_grant.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ box.schema.user.grant()
3131

3232
**Variation:** instead of
3333
:samp:`box.schema.user.grant('{username}','usage,session','universe',nil,` :code:`{if_not_exists=true})`
34-
say :samp:`box.schema.user.enable('{username}')`.
34+
say :samp:`box.schema.user.enable('{username}')` (see section :ref:`box.schema.user.enable <box_schema-user_enable>`).
3535

3636
The possible options are:
3737

doc/reference/reference_lua/box_schema/user_revoke.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ box.schema.user.revoke()
3131

3232
**Variation:** instead of
3333
:samp:`box.schema.user.revoke('{username}','usage,session','universe',nil,` :code:`{if_exists=true})`
34-
say :samp:`box.schema.user.disable('{username}')`.
34+
say :samp:`box.schema.user.disable('{username}')` (see section :ref:`box.schema.user.disable <box_schema-user_disable>`).
3535

3636
**Example:**
3737

0 commit comments

Comments
 (0)