Skip to content
8 changes: 8 additions & 0 deletions doc/reference/reference_lua/box_schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ Below is a list of all ``box.schema`` functions.
* - :doc:`./box_schema/user_revoke`
- Revoke privileges from a user or a role

* - :doc:`./box_schema/user_enable`
- Grant ``usage`` and ``session`` permissions

* - :doc:`./box_schema/user_disable`
- Revoke ``usage`` and ``session`` permissions

* - :doc:`./box_schema/user_password`
- Get a hash of a user's password

Expand Down Expand Up @@ -105,6 +111,8 @@ Below is a list of all ``box.schema`` functions.
box_schema/user_exists
box_schema/user_grant
box_schema/user_revoke
box_schema/user_enable
box_schema/user_disable
box_schema/user_password
box_schema/user_passwd
box_schema/user_info
Expand Down
31 changes: 31 additions & 0 deletions doc/reference/reference_lua/box_schema/user_disable.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _box_schema-user_disable:

===============================================================================
box.schema.user.disable()
===============================================================================

.. module:: box.schema

.. function:: box.schema.user.disable(username)

Revokes ``usage`` and ``session`` permissions from the subject user. Equivalent to the following call:

.. code-block:: lua

box.schema.user.revoke(username, 'usage,session', 'universe', nil, {if_not_exists = true})

.. NOTE::

* ``session`` - allows the binary protocol layer (iproto) to authenticate the user

* ``usage`` - lets user use their privileges on database objects (such as read, write and alter space)

For more information about revoking permissions see section :ref:`box.schema.user.revoke <box_schema-user_revoke>`.

:param string username: the name of the subject user

:return: (if success) nothing

Possible errors:

* ``NO_SUCH_USER`` - in case the subject user is not found.
31 changes: 31 additions & 0 deletions doc/reference/reference_lua/box_schema/user_enable.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _box_schema-user_enable:

===============================================================================
box.schema.user.enable()
===============================================================================

.. module:: box.schema

.. function:: box.schema.user.enable(username)

Grants ``usage`` and ``session`` permissions to the subject user. Equivalent to the following call:

.. code-block:: lua

box.schema.user.grant(username, 'usage,session', 'universe', nil, {if_not_exists = true})

.. NOTE::

* ``session`` - allows the binary protocol layer (iproto) to authenticate the user

* ``usage`` - lets user use their privileges on database objects (such as read, write and alter space)

For more information about granting permissions see section :ref:`box.schema.user.grant <box_schema-user_grant>`.

:param string username: the name of the subject user

:return: (if success) nothing

Possible errors:

* ``NO_SUCH_USER`` - in case the subject user is not found.
2 changes: 1 addition & 1 deletion doc/reference/reference_lua/box_schema/user_grant.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ box.schema.user.grant()

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

The possible options are:

Expand Down
2 changes: 1 addition & 1 deletion doc/reference/reference_lua/box_schema/user_revoke.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ box.schema.user.revoke()

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

**Example:**

Expand Down