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

Type
Name
Summary

Constant representing the accessible flag for form security.

Constant representing the delete flag for table security.

Constant representing the insert flag for table security.

Constant representing the read flag for table security.

Constant representing the tracking flag for table security (tracks sql insert/update/delete).

Constant representing the tracking flag for table security (tracks sql select).

Constant representing the update flag for table security.

Constant representing the viewable flag for form security.

Methods Summarized

Type
Name
Summary

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 whether form is accessible.

Returns whether element from form is accessible.

Returns a boolean value for security rights.

Returns a boolean value for security rights.

Returns a boolean value for security rights.

Returns a boolean value for security rights.

Returns whether form is viewable.

Returns whether element from form is viewable.

Changes the username of the specified userUID.

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 client ID.

Returns the form elements UUID's as dataset, the one with no name is the form itself.

Get all the permissions of the solution (returns a dataset).

Get all the permissions for given user UID.

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 all the permissions of the current user.

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.

Get all the users in the security settings (returns a dataset).

Get all the users in the security settings (returns a dataset).

Check if the current user has the given permission

Check if the given user has the given permission

Login to be able to leave the solution loginForm.

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.