Security
(security)
Overview
The security
object provides a comprehensive API for managing users, groups, and permissions in a solution. It includes constants for form and table security and methods to control user access and permissions programmatically.
Security constants such as ACCESSIBLE
, DELETE
, INSERT
, READ
, and UPDATE
define flags for controlling access to forms and tables. These constants allow developers to set permissions using datasets and apply them at runtime.
The API includes methods for managing users, such as createUser
, deleteUser
, and changeUserName
. Permissions can be assigned or removed with addPermissionToUser
and removePermissionFromUser
. Developers can query permissions using methods like hasPermission
or retrieve user-related information with getUserName
and getUserUID
.
Authentication is supported via the authenticate
method, which integrates with custom authenticators or Servoy's built-in system. The API also allows setting and managing tenant values to filter data access by tenant.
The security
object facilitates dynamic security configurations and provides control over application access at a granular level.
For more information, please refer to the overall Security documentation.
Constants Summarized
Constant representing the tracking flag for table security (tracks sql insert/update/delete).
Methods Summarized
Gives a user a permission Note: this method can only be called by an admin.
Authenticate to the Servoy Server using one of the installed authenticators or the Servoy default authenticator.
Authenticate to the Servoy Server using one of the installed authenticators or the Servoy default authenticator.
Returns true if the password for that userUID is correct, else false.
Creates a new user, returns new uid (or null when permission couldn't be created or user alreay exist).
Creates a new user, returns new uid (or null when permission couldn't be created or user alreay exist).
Returns the form elements UUID's as dataset, the one with no name is the form itself.
Retrieves the username of the currently logged in user on operating system level.
Retrieve the tenant value for this Client, this value will be used as the value for all tables that have a column marked as a tenant column.
Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.
Get the current user name (null if not logged in), finds the user name for given user UID if passed as parameter.
Get the current user UID (null if not logged in); finds the userUID for given user_name if passed as parameter.
Get the current user UID (null if not logged in); finds the userUID for given user_name if passed as parameter.
void
Logout the current user and close the solution, if the solution requires authentication and user is logged in.
void
Logout the current user and close the solution, if the solution requires authentication and user is logged in.
void
Logout the current user and close the solution, if the solution requires authentication and user is logged in.
void
Logout the current user and close the solution, if the solution requires authentication and user is logged in.
void
Logout the current user and close the solution, if the solution requires authentication and user is logged in.