B&B Electronics VFG3000 - Manual User Manual
Page 362

T
EST
A
CCESS
(
RIGHTS
,
PROMPT
)
V
LINX
F
IELDBUS
G
ATEWAY
M
ANAGER
U
SER
M
ANUAL
P
AGE
346
T
EST
A
CCESS
(
RIGHTS
,
PROMPT
)
A
RGUMENT
T
YPE
D
ESCRIPTION
rights
int
The required access rights.
prompt
cstring
The prompt to be used in the log-on popup.
D
ESCRIPTION
Returns a value of true or false depending on whether the current user has access rights
defined by the
rights
parameter. This parameter comprises a bit-mask representing the
various user-defined rights, with bit 0 (ie. the bit with a value of 0x01) representing User
Right 1, bit 1 (ie. the bit with a value of 0x02) representing User Right 2 and so on. If no user
is currently logged on, the system will display a popup to ask for user credentials, using the
prompt
argument to indicate why the popup is being displayed. The function is typically used
in programs that perform a number of actions that might be subject to security, and that might
otherwise be interrupted by a log-on popup. By executing this function before the actions are
performed, you can provide a better indication to the user as to why a log-on is required, and
you can avoid a security failure part way through a series of operations.
F
UNCTION
T
YPE
This function is passive.
R
ETURN
T
YPE
int.
E
XAMPLE
if( TestAccess(1, “Clear all data?”) ) {
Data1 := 0;
Data2 := 0;
Data3 := 0;
}