Skip to content

Commit 1b17014

Browse files
committed
Updates by comments
1 parent 81b0d76 commit 1b17014

File tree

2 files changed

+31
-21
lines changed

2 files changed

+31
-21
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
# grant privilege
2+
credentials:
3+
users:
4+
alice:
5+
privileges:
6+
- permissions: [execute]
7+
lua_call: [my_func, my_func2]
8+
9+
# take away a privilege:
110
credentials:
211
users:
312
alice:
413
privileges:
514
- permissions: [execute]
615
lua_call: [my_func]
16+
17+
# take away a privilege:
18+
credentials:
19+
users:
20+
alice:
21+
privileges: []
22+
# - permissions: [execute]
23+
# lua_call: [my_func, my_func2]

doc/reference/configuration/configuration_reference.rst

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,11 +1447,24 @@ credentials.users.*
14471447
.. confval:: <user_or_role_name>.privileges.lua_call
14481448

14491449
A list of global user-defined Lua functions that this user or a user with this role can call.
1450-
To allow calling all such functions, specify the ``all`` value.
1450+
To allow calling a specific function, specify its name as the value.
1451+
To allow calling all global Lua functions except built-in ones functions, specify the ``all`` value.
14511452

14521453
This option should be configured together with the ``execute``
14531454
:ref:`permission <configuration_reference_credentials_privileges_permissions>`.
14541455

1456+
To take a previously granted privilege away, specify the ``lua_call`` option without the function name,
1457+
or with an empty privileges array (furhter options may retain commented-out).
1458+
1459+
Since version :doc:`3.3.0 </release/3.3.0>`, the ``lua_call`` option allows granting users privileges to call specified lua function on
1460+
the instance in runtime.
1461+
1462+
Example to grant and take away custom functions from the 'alice' user:
1463+
1464+
.. literalinclude:: /code_snippets/snippets/config/instances.enabled/lua_call/config.yaml
1465+
:language: yaml
1466+
:dedent:
1467+
14551468
.. _configuration_reference_credentials_privileges_sql:
14561469

14571470
.. confval:: <user_or_role_name>.privileges.sql
@@ -3220,26 +3233,6 @@ The ``lua`` section outlines the configuration parameters related to the Lua env
32203233
| Default: 2147483648 (2GB)
32213234
| Environment variable: TT_LUA_MEMORY
32223235
3223-
.. _configuration_reference_lua_call:
3224-
3225-
.. confval:: lua_call
3226-
3227-
Since version :doc:`3.3.0 </release/3.3.0>`, the ``lua_call`` option allows the specified user to perform the specified lua function on
3228-
the instance during runtime.
3229-
3230-
Via the ``lua_call`` option, one can grant permissions to the function to any user registered on the instance.
3231-
3232-
Note that the special option ``lua_call: [all]`` is also supported, granting access to all global Lua functions except built-in ones,
3233-
bypassing database restrictions.
3234-
3235-
After the instance is rebooted, permissions defined via the ``lua_call`` options are reset to the values stored in the database.
3236-
3237-
Example to grant custom function to the 'alice' user:
3238-
3239-
.. literalinclude:: /code_snippets/snippets/config/instances.enabled/lua_call/config.yaml
3240-
:language: yaml
3241-
:dedent:
3242-
32433236
.. _configuration_reference_memtx:
32443237

32453238
memtx

0 commit comments

Comments
 (0)