HasUserPrivilege
Description
Tests a user privilege level and, for the specified privilege, returns Boolean True if the current user has the privilege and otherwise returns False. Use this method to determine whether the user has the privilege to perform the specific task.
Data access, reporting, and management can be controlled at the database, record type (EntityDef), and field (column) levels. This method tests privileges related to record types and fields. To manage security at the record type and field levels, both your HCL Compass client and the session database must support security privileges.
You can test the user privileges by specifying
one of the UserPrivilegeMaskType
constants
.
Syntax
VBScript
session.HasUserPrivilege
(priv_mask)
Perl
session->HasUserPrivilege
(priv_mask);
- Identifier
- Description
- session
- The Session object that represents the current database-access session.
- priv_mask
- A UserPrivilegeMaskType enumerated constant (which is a Long) specifying the privilege to test.
- Return value
- A Boolean True if the current user has the specified privilege; otherwise, the return value is Boolean False.
Examples
VBScript
has_privilege = session.HasUserPrivilege AD_SUPER_USER
Perl
$has_privilege = $session->HasUserPrivilege ($CQPerlExt::CQ_SUPER_USER);