Check User Function Usage (QSYCKUFU, QsyCheckUserFunctionUsage) API


  Start of changeRequired Parameter Group for QSYCKUFU:

1 Usage indicator Output Char(1)
2 Function ID Input Char(30)
3 User profile name Input Char(10)
4 Error code I/O Char(*)

  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: YesEnd of change

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:

1 The user is not allowed to use the specified function.
2 The user is allowed to use the specified function.

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:

*CURRENT The usage check is made for the user currently running.

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

Message ID Error Message Text
CPF2204 E User profile &1 not found.
CPF2225 E Not able to allocate internal system object.
CPF228A E Function &1 not registered.
CPF3C36 E Number of parameters, &1, entered for this API was not valid.
CPF3C90 E Literal value cannot be changed.
CPF3CD9 E Requested function cannot be performed at this time.
CPF3CDA E Registration facility repository not available for use.
CPF3CF1 E Error code parameter not valid.
CPF3CF2 E Error(s) occurred during running of &1 API.
CPF8100 E All CPF81xx messages could be returned. xx is from 01 to FF.
CPF9810 E Library &1 not found.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API introduced: V4R3
Top | Security APIs | APIs by category