diff --git a/doc/reference/reference_lua/box_schema.rst b/doc/reference/reference_lua/box_schema.rst index c20c4dff5..b2a60c0e8 100644 --- a/doc/reference/reference_lua/box_schema.rst +++ b/doc/reference/reference_lua/box_schema.rst @@ -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 @@ -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 diff --git a/doc/reference/reference_lua/box_schema/user_disable.rst b/doc/reference/reference_lua/box_schema/user_disable.rst new file mode 100644 index 000000000..e115ee43e --- /dev/null +++ b/doc/reference/reference_lua/box_schema/user_disable.rst @@ -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 `. + + :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. \ No newline at end of file diff --git a/doc/reference/reference_lua/box_schema/user_enable.rst b/doc/reference/reference_lua/box_schema/user_enable.rst new file mode 100644 index 000000000..aad9886f2 --- /dev/null +++ b/doc/reference/reference_lua/box_schema/user_enable.rst @@ -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 `. + + :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. \ No newline at end of file diff --git a/doc/reference/reference_lua/box_schema/user_grant.rst b/doc/reference/reference_lua/box_schema/user_grant.rst index de4f17af3..fb6150e6a 100644 --- a/doc/reference/reference_lua/box_schema/user_grant.rst +++ b/doc/reference/reference_lua/box_schema/user_grant.rst @@ -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 `). The possible options are: diff --git a/doc/reference/reference_lua/box_schema/user_revoke.rst b/doc/reference/reference_lua/box_schema/user_revoke.rst index 6bc955921..bea2bdb82 100644 --- a/doc/reference/reference_lua/box_schema/user_revoke.rst +++ b/doc/reference/reference_lua/box_schema/user_revoke.rst @@ -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 `). **Example:**