Programs that ignore adopted authority

You can specify the use adopted authority (USEADPAUT) parameter to control whether a program uses the adopted authority.

You might not want some programs to use the adopted authority of previous programs in the call stack. For example, if you use an initial menu program that adopts owner authority, you might not want some of the programs called from the menu program to use that authority.

The use adopted authority (USEADPAUT) parameter of a program determines whether the system uses the adopted authority of previous programs in the stack when checking authority for objects.

When you create a program, the default is to use adopted authority from previous programs in the stack. If you do not want the program to use adopted authority, you can change the program with the Change Program (CHGPGM) command or Change Service Program (CHGSRVPGM) command to set the USEADPAUT parameter to *NO. If a program is created using REPLACE(*YES) on the CRTxxxPGM command, the new copy of the program has the same USRPRF, USEADPAUT, and AUT values as the replaced program.

The topic Ignoring adopted authority shows an example of how to use this parameter in menu design. See Use Adopted Authority (QUSEADPAUT) for information about the QUSEADPAUT system value.

Attention: In some situations, you can use the MODINVAU MI instruction to prevent passing adopted authority to called functions. The MODINVAU instruction can be used to prevent passing any adopted authority from C and C++ programs to called functions in another program or service program. This might be useful when you do not know the USEADPAUT setting of the function that is called.