Tarantool CE/EE Documentation portal logo
Support
Updated at September 7, 2026   01:25 PM

box.session.euid()

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 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 the user-name parameter of the box.session.su() function).

    • box.session.uid() returns the ID of the original user (the user who calls the box.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 created function-name.
    • box.session.uid() returns the ID of the user who calls function-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...