-
Notifications
You must be signed in to change notification settings - Fork 43
Adds box.schema.user.enable and box.schema.user.disable methods #5123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: latest
Are you sure you want to change the base?
Changes from all commits
81ffdec
f69a513
0c0e2c1
7d55ae3
e4162dc
8167e3f
6c9e8a1
a531918
b12f6f0
50e0740
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. _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`` - (cannot be granted to a role) if is not granted, ``IPROTO_AUTH`` always fails connection to the user, so does ``box.session.su()`` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'Connection to the user' is a bit unclear for me and also it is not clear what is meant about
|
||
|
||
* ``usage`` - (cannot be granted to a role) lets user use their privileges on database objects (e.g. read, write and alter space) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
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 | ||
|
||
(if failure) The error is raised ``- error: User 'username' is not found`` |
Totktonada marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. _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`` - (cannot be granted to a role) if is not granted, ``IPROTO_AUTH`` always fails connection to the user, so does ``box.session.su()`` | ||
|
||
* ``usage`` - (cannot be granted to a role) lets user use their privileges on database objects (e.g. 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 | ||
|
||
(if failure) The error is raised ``- error: User 'username' is not found`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits:
I would replace
'{username}'
with justusername
(like a variable), because we mention it is this form in the arguments list above.I would split function arguments with whitespaces (and also surround
=
with them):=>
This is the usual code style for Lua within the server team (see also https://www.tarantool.io/en/doc/latest/contributing/lua_style_guide/).
Trailing whitespaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found how to fix them in vscode))