$FlsAcc

From m204wiki
Revision as of 23:58, 1 January 2014 by JAL (talk | contribs)
Jump to navigation Jump to search

The $FLSACC function, combined with the $FLSCHK function, allows a User Language request to check for field-level security access violations before they occur. This reduces evaluation-time errors and request cancellations, and it helps to ensure that the files being updated are not left in a logically inconsistent state (Resolution of field types and levels").

$FLSACC can determine a user's access rights to a particular field or to all fields in a file or group. The function returns a character string representing the user's access rights to the specified field(s). If the field is not defined in the file or group, a null string is returned. The string normally contains a combination of the characters listed in this table:

Character Meaning
S SELECT access rights
R READ access rights
U UPDATE access rights
A ADD access rights

Syntax

The format of the $FLSACC function is:

$FLSACC (fieldname [,name])

where:

  • fieldname is a character string that is interpreted as the name of the field whose access is being checked.
  • If this argument is omitted or null, every field in the file or group specified in the name argument is checked. In this case, the output string returned by $FLSACC contains an access indication (S, R, U, A) only if that level of access applies to every field in the file or group. This use of $FLSACC is costly system overhead because all field descriptions must be examined.

  • name is optional; use it to control the file or group context of the function. The format for this argument is:
  • [[FILE | [PERM | TEMP] GROUP] name [AT location] | $CURFILE | $UPDATE]

    If access for the current file of a FOR loop is desired, $CURFILE can be used as the second argument. $UPDATE can be used to indicate the name of the update file in the current group. $CURFILE and $UPDATE are described in detail in $CURFILE and $UPDATE functions. For single file context, the field level security access rights are well defined. If a field name is specified in group context, $FLSACC returns the maximum access rights for the group. If the name argument is omitted or null, the context used for the check is the context of the statement that contains the function.