box.session.euid()
Returns
the effective user ID of the current user.
The system uses the effective user ID to determine the process's
permissions at any given moment. This is the same as
/reference/reference_lua/box_session/uid, except two cases:
-
box.session.euid()is called within a function invoked by box.session.su(). In this case:-
box.session.euid()returns the ID of the changed user (the user who is specified by theuser-nameparameter of thebox.session.su()function). -
box.session.uid()returns the ID of the original user (the user who calls thebox.session.su()function).
-
-
box.session.euid()is called within a function specified with box.schema.func.create(function-name, {setuid= true}) and the binary protocol is in use. In this case:box.session.euid()returns the ID of the user who createdfunction-name.box.session.uid()returns the ID of the user who callsfunction-name.
Return type
number
Example:
tarantool> box.session.su('admin')---...tarantool> box.session.uid(), box.session.euid()---- 1- 1...tarantool> function f() return {box.session.uid(),box.session.euid()} end---...tarantool> box.session.su('guest', f)---- - 1- 0...