Check User Function Usage (QSYCKUFU, QsyCheckUserFunctionUsage) API


Required Parameter Group for QSYCKUFU:


  Default Public Authority: *USE

  Threadsafe: Yes



  Syntax for QsyCheckUserFunctionUsage:
 #include <qsyfnusg.h>

 void QsyCheckUserFunctionUsage
        (char    *Usage_indicator,
         char     Function_ID[30],
         char     User_profile_name[10],
         void    *Error_code);

  Service Program: QSYFNUSG

  Default Public Authority: *USE

  Threadsafe: Yes

The Check User Function Usage (OPM, QSYCKUFU; ILE, QsyCheckUserFunctionUsage) API checks to see if a user is allowed to use the specified function, and returns an indication of whether the user is allowed to use the function. When the check is made, the usage setting for the user, its group, the default usage value, and the allow *ALLOBJ indicator for the function are taken into account. Following are the steps the system takes to determine the usage indicator for the user to the function:

  1. Is the *ALLOBJ indicator for the function set to 1 and does the user have *ALLOBJ special authority? If yes to both, set the returned usage indicator to usage allowed and return. Otherwise, continue with step 2.
  2. Does the user have a usage setting for the function? If yes, set the returned usage indicator to the usage indicator for the user and return. Otherwise, continue with step 3.
  3. Does the user have any groups? If yes, continue with step 3a. Otherwise, go to step 4.
    1. Repeat the following steps for each group:
      1. Is the *ALLOBJ indicator for the function set to 1 and does the group have *ALLOBJ special authority? If yes to both, set the returned usage indicator to usage allowed and return. Otherwise, go to step 3a2.
      2. Does the group have a usage setting for the function? If yes, go to step 3a2a. Otherwise, go look at the next group, starting over with step 3a1.
        1. Does the group's usage setting allow usage of the function? If yes, set the returned usage indicator to usage allowed and return. Otherwise, set a flag that indicates a group usage setting is found and go look at the next group, starting over with step 3a1.
    2. Is the group usage setting found flag set on? If yes, set the returned usage indicator to usage not allowed and return. Otherwise, continue with step 4.
  4. Set the returned usage indicator to the default usage value and return.

Authorities and Locks

API Public Authority
*USE
Function Registration Lock
*SHRNUP

Required Parameter Group

Usage indicator
OUTPUT; CHAR(1)

Whether the user is allowed to use the specified function.
This parameter contains one of the following values:


Function ID
INPUT; CHAR(30)

The ID of the function to check usage information for.

User profile name
INPUT; CHAR(10)

The name of the user to check for usage to the specified function.

You can specify the following special value:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Error Messages



API introduced: V4R3

[ Back to top | Security APIs | APIs by category ]