IBM i "Not authorized" messages, CPF9802, CPF2182 and CPF9820
What IBM i messages CPF9802, CPF2182 and CPF9820 mean, how to see your authority, and what to ask your administrator for.
CPF9802 Not authorized to object &2 in &3.
CPF2182 Not authorized to library &1.
CPF9820 Not authorized to use library &1.
These are IBM's message texts. The & parts are filled in with the real names when the message appears. They mean the system found what you asked for, and your user profile does not have the authority the action needs. If the message says an object or library is not found, see IBM i "not found" messages.
Read the message
- CPF9802 names an object and its library. The authority problem is on that object.
- CPF2182 names a library. The authority problem is on that library.
- CPF9820 names a library. The authority problem is on that library.
Write down the names it shows. You will need them for the administrator.
See your authority
The DSPOBJAUT command displays the authorized users of an object and their authority. IBM documents that if you do not have object management authority (*OBJMGT) to the object, it shows only your own name and authorities, not the others. Run it like this for an object:
DSPOBJAUT OBJ(MYLIB/MYFILE) OBJTYPE(*FILE)
For a library, use OBJ(QSYS/MYLIB) with OBJTYPE(*LIB).
What the authority levels mean
IBM's GRTOBJAUT documentation describes these:
*USE: basic operations, such as running a program or reading a file. You cannot change the object.*CHANGE: all operations except those limited to the owner or controlled by object existence and object management authority.*EXCLUDE: no access.
A library also needs the right authority so that its objects can be located: the *EXECUTE authority is described as the one needed to run a program or locate an object in a library.
What to ask for
Give the administrator the full message and what you were doing. They can grant authority with GRTOBJAUT. IBM lists who can run it:
- the object's owner,
- a user with object management authority to the object,
- a user with
*ALLOBJspecial authority, - a user authorized to the Database Security Administrator function (
QIBM_DB_SECADM).
Ask for the least authority that lets you do the task, for example *USE for read-only work. If a task must run under another profile instead, see IBM i equivalent of sudo: SBMJOB USER, adopted authority and profile swaps.
Authority can come from several places
The same IBM page explains that authority can be granted to named users, to *PUBLIC, and through an authorization list. So the fix may be a change to a group, a list or the public authority, rather than to your profile alone.
Related
- IBM i "not found" messages, CPF9801 and CPF2105
- IBM i sign-on messages
- IBM i equivalent of sudo: SBMJOB USER, adopted authority and profile swaps