Skip to content

Commit 5afceb5

Browse files
authored
Adds description of application role editing process (#5237)
* Adds description of application role editing process * Fixes #5230
1 parent 39fe077 commit 5afceb5

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

doc/platform/app/app_roles.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,24 @@ As a result, a role module should return an object that has corresponding functi
118118
end,
119119
}
120120
121-
The examples below show how to do this.
121+
The examples in this article show how to do this.
122+
123+
You can omit the optional steps and get a simple role as in the example below.
124+
125+
.. code-block:: lua
126+
127+
return {
128+
validate = function() -- ... -- end,
129+
apply = function() -- ... -- end,
130+
stop = function() -- ... -- end,
131+
}
132+
133+
You can modify a role, for example, by adding dependencies or specifying the on_event callback.
134+
If you modify a role, you need to restart the Tarantool instance with the role in order to apply the changes.
122135

123136
.. NOTE::
124137

125-
Code snippets shown in this section are included from the following application: `application_role_cfg <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/application_role_cfg>`_.
138+
- Code snippets shown in this section are included from the following application: `application_role_cfg <https://github.com/tarantool/doc/tree/latest/doc/code_snippets/snippets/config/instances.enabled/application_role_cfg>`_.
126139

127140
.. _roles_create_custom_role_schema:
128141

@@ -163,7 +176,6 @@ is used to validate the ``greeting`` value:
163176

164177
If the configuration is not valid, ``validate()`` reports an unrecoverable error by throwing an error object.
165178

166-
167179
.. _roles_create_custom_role_apply:
168180

169181
Applying a role configuration
@@ -180,8 +192,6 @@ In the example below, the ``apply()`` function uses the :ref:`log <log-module>`
180192
:end-before: local function stop
181193
:dedent:
182194

183-
184-
185195
.. _roles_create_custom_role_stop:
186196

187197
Stopping a role

0 commit comments

Comments
 (0)