Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
d7abf0c0
Commit
d7abf0c0
authored
9 years ago
by
ocelot-inc
Browse files
Options
Downloads
Patches
Plain Diff
changes related to issue#668 + issue#669 + issue#868
parent
f84ad58c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/sphinx/book/box/authentication.rst
+22
-19
22 additions, 19 deletions
doc/sphinx/book/box/authentication.rst
doc/sphinx/book/box/triggers.rst
+31
-0
31 additions, 0 deletions
doc/sphinx/book/box/triggers.rst
with
53 additions
and
19 deletions
doc/sphinx/book/box/authentication.rst
+
22
−
19
View file @
d7abf0c0
...
@@ -129,19 +129,27 @@ Notes: The maximum number of users is 32.
...
@@ -129,19 +129,27 @@ Notes: The maximum number of users is 32.
Privileges and the _priv space
Privileges and the _priv space
===========================================================
===========================================================
The fields in the _priv space are: the numeric id of the user who gave the
The fields in the _priv space are:
privilege ("grantor_id"), the numeric id of the user who received the
the numeric id of the user who gave the privilege ("grantor_id"),
privilege ("grantee_id"), the id of the object, the type of object - "space"
the numeric id of the user who received the privilege ("grantee_id"),
or "function" or "universe", the type of operation - "read" or "write" or
the type of object - "space" or "function" or "universe",
"execute" or a combination such as "read,write,execute".
the numeric id of the object,
the type of operation - "read" = 1, or "write" = 2, or
The function for granting a privilege is:
"execute" = 4, or a combination such as "read,write,execute".
:samp:`box.schema.user.grant({user-name-of-grantee}, {operation-type}, {object-type}, {object-name})` or
:samp:`box.schema.user.grant({user-name-of-grantee}, {operation-type}, 'universe')`.
The function for granting a privilege is: |br|
:samp:`box.schema.user.grant({grantee-user-name-or-id}, {operation-type}, {object-type}, {object-name}[, {grant-option}])`
The function for revoking a privilege is:
or |br|
:samp:`box.schema.user.revoke({user-name-of-grantee}, {operation-type}, {object-type}, {object-name})` or
:samp:`box.schema.user.grant({grantee-user-name-or-id}, {operation-type}, 'universe'[, {grant-option}])` |br|
:samp:`box.schema.user.revoke({user-name-of-grantee}, {operation-type}, 'universe')`.
where 'universe' means 'all objects',
and the optional grant-option can be :code:`{grantor=grantor_id}`,
:code:`{if_not_exists=true|false}`, or both.
The function for revoking a privilege is: |br|
:samp:`box.schema.user.revoke({grantee-user-name-or-id}, {operation-type}, {object-type}, {object-name}[, {revoke-option}])`
or |br|
:samp:`box.schema.user.revoke({grantee-user-name-or-id}, {operation-type}, 'universe'[, {revoke-option}])` |br|
where the optional revoke-option can be :code:`{if_exists=true|false}`.
For example, here is a session where the admin user gave the guest user the
For example, here is a session where the admin user gave the guest user the
privilege to read from a space named space55, and then took the privilege away:
privilege to read from a space named space55, and then took the privilege away:
...
@@ -156,8 +164,7 @@ privilege to read from a space named space55, and then took the privilege away:
...
@@ -156,8 +164,7 @@ privilege to read from a space named space55, and then took the privilege away:
Notes: Generally privileges are granted or revoked by the owner of the object (the
Notes: Generally privileges are granted or revoked by the owner of the object (the
user who created it), or by the 'admin' user. Before dropping any objects
user who created it), or by the 'admin' user. Before dropping any objects
or users, steps should be taken to ensure that all their associated
or users, steps should be taken to ensure that all their associated
privileges have been revoked. Only the 'admin' user can grant privileges
privileges have been revoked. Only the 'admin' user can grant privileges for the 'universe'.
for the 'universe'.
===========================================================
===========================================================
...
@@ -278,10 +285,6 @@ or indirectly.
...
@@ -278,10 +285,6 @@ or indirectly.
Drop a role.
Drop a role.
.. function:: info()
Get information about a role, including what privileges have been granted to the role.
.. function:: grant(role-name, 'execute', 'role', role-name)
.. function:: grant(role-name, 'execute', 'role', role-name)
Grant a role to a role.
Grant a role to a role.
...
...
This diff is collapsed.
Click to expand it.
doc/sphinx/book/box/triggers.rst
+
31
−
0
View file @
d7abf0c0
...
@@ -204,3 +204,34 @@ each trigger by replacing with ``nil``.
...
@@ -204,3 +204,34 @@ each trigger by replacing with ``nil``.
box.space.T:run_triggers(false)
box.space.T:run_triggers(false)
box.space.T:on_replace(nil, F)
box.space.T:on_replace(nil, F)
box.space.T:on_replace(nil, F)
box.space.T:on_replace(nil, F)
===========================================================
Getting a list of triggers
===========================================================
The code :code:`on_connect()` -- with no arguments --
lists all connect-trigger functions;
:code:`on_auth()` lists all authentication-trigger functions;
:code:`on_disconnect()` lists all disconnect-trigger functions;
:code:`on_replace()` lists all replace-trigger functions.
In the following example a user finds that there are
three functions associated with :code:`on_connect`
triggers, and executes the third function, which happens to
contain the line "print('function #3')".
| :codenormal:`tarantool>` :codebold:`box.session.on_connect()`
| :codenormal:`---`
| :codenormal:`- - 'function: 0x416ab6f8'`
| |nbsp| |nbsp| :codenormal:`- 'function: 0x416ab6f8'`
| |nbsp| |nbsp| :codenormal:`- 'function: 0x416ad800'`
| :codenormal:`...`
|
| :codenormal:`tarantool>` :codebold:`box.session.on_connect()[3]()`
| :codenormal:`function #3`
| :codenormal:`---`
| :codenormal:`...`
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment