public class QSYSPermission extends UserPermission
The QSYSPermission class represents the permissions for the specified user of an object in the traditional IBM i library structure stored in QSYS.LIB.
A object stored in QSYS.LIB can set its authorities by setting a single object authority value or by setting the individual object and data authorities.
Use getObjectAuthority() to display the current object authority or setObjectAuthority() to set the current object authority using a single value. Valid values are: *ALL, *AUTL, *CHANGE, *EXCLUDE, and *USE.
The detailed object authority can be set to one or more of the following values: alter, exist, management, operational, reference. Use the appropriate set methods (setAlter(), setExistence(), setManamagement(), setOperational(), or setReference()) to set the value on or off. After all values are set, use the commit() method from the Permission class to send the changes to the system.
The data authority can be set to one or more of the following values: add, delete, execute, read, or update. Use the appropriate set methods (setAdd(), setDelete(), setExecute(), setRead(), or setUpdate()) to set the value on or off. After all the values are set, use the commit() method from the Permission class to send the changes to the system.
The single authority actually represents a combination of the detailed object authorities and the data authorities. Selecting a single authority will automatically turn on the appropriate detailed authorities. Likewise, selecting various detailed authorities will change the appropriate single authority values.
For more information on object authority commands, refer to IBM i CL commands GRTOBJAUT (Grant object authority) and EDTOBJAUT (Edit object authority).
GROUPINDICATOR_GROUP, GROUPINDICATOR_SPECIALVALUE, GROUPINDICATOR_USER
Constructor and Description |
---|
QSYSPermission(java.lang.String userProfileName)
Constructs a QSYSPermission object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getObjectAuthority()
Returns the object authority of the user specified as a single value.
|
static boolean |
hasObjectAuthorities(AS400 system,
java.lang.String userProfileName,
java.lang.String objectPath,
java.lang.String[] authorityList)
Determines if the user has the given authorities to the object on the system.
|
boolean |
isAdd()
Indicates if the user has the data authority of add.
|
boolean |
isAlter()
Indicates if the user has the object authority of alter.
|
boolean |
isDelete()
Indicates if the user has the data authority of delete.
|
boolean |
isExecute()
Indicates if the user has the data authority of execute.
|
boolean |
isExistence()
Indicates if the user has the object authority of existence.
|
boolean |
isManagement()
Indicates if the user has the object authority of management.
|
boolean |
isOperational()
Indicates if the user has the object authority of operational.
|
boolean |
isRead()
Indicates if the user has the data authority of read.
|
boolean |
isReference()
Indicates if the user has the object authority of reference.
|
boolean |
isUpdate()
Indicates if the user has the data authority of update.
|
void |
setAdd(boolean authority)
Sets the add data authority.
|
void |
setAlter(boolean authority)
Sets the alter object authority.
|
void |
setDelete(boolean authority)
Sets the delete data authority.
|
void |
setExecute(boolean authority)
Sets the execute data authority.
|
void |
setExistence(boolean authority)
Sets the existence object authority.
|
void |
setManagement(boolean authority)
Sets the management object authority.
|
void |
setObjectAuthority(java.lang.String authority)
Sets the object authority of the user using a single value.
|
void |
setOperational(boolean authority)
Sets the operational object authority.
|
void |
setRead(boolean authority)
Sets the read data authority.
|
void |
setReference(boolean authority)
Sets the reference object authority.
|
void |
setUpdate(boolean authority)
Sets the update data authority.
|
clone, getGroupIndicator, getUserID, isAuthorizationListManagement, isFromAuthorizationList, setAuthorizationListManagement, setFromAuthorizationList
public QSYSPermission(java.lang.String userProfileName)
userProfileName
- The name of the user profile.public java.lang.String getObjectAuthority()
setObjectAuthority(String)
public static boolean hasObjectAuthorities(AS400 system, java.lang.String userProfileName, java.lang.String objectPath, java.lang.String[] authorityList) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException
system
- The system.userProfileName
- The name of the user profile.objectPath
- The full path of the object. For example, "/QSYS.LIB/FRED.LIB".authorityList
- The list of authorities. At least one authority must be specified.
Possible authorities include:
*EXCLUDE *ALL *CHANGE *USE *AUTLMGT *OBJALTER *OBJOPR *OBJMGT *OBJEXIST *OBJREF *READ *ADD *UPD *DLT *EXECUTE
AS400Exception
- If the system returns an error message.AS400SecurityException
- If a security or authority error occurs.ErrorCompletingRequestException
- If an error occurs before the request is completed.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the object does not exist.public boolean isAdd()
public boolean isAlter()
public boolean isDelete()
public boolean isExecute()
public boolean isExistence()
public boolean isManagement()
public boolean isOperational()
public boolean isRead()
public boolean isReference()
public boolean isUpdate()
public void setAdd(boolean authority)
authority
- true to set the data authority of add on;
false to set the data authority of add off.public void setAlter(boolean authority)
authority
- true to set the object authority of alter on;
false to set the object authority of alter off.public void setDelete(boolean authority)
authority
- true to set the data authority of delete on;
false to set the data authority of delete off.public void setExecute(boolean authority)
authority
- true to set the data authority of execute on;
false to set the data authority of execute off.public void setExistence(boolean authority)
authority
- true to set the object authority of existence on;
false to set the object authority of existence off.public void setManagement(boolean authority)
authority
- true to set the object authority of management on;
false to set the object authority of management off.public void setObjectAuthority(java.lang.String authority)
authority
- The object authority of the user.
Valid values are:
public void setOperational(boolean authority)
authority
- true to set the object authority of operational on;
false to set the object authority of operational off.public void setRead(boolean authority)
authority
- true to set the data authority of read on;
false to set the data authority of read off.public void setReference(boolean authority)
authority
- true to set the object authority of reference on;
false to set the object authority of reference off.public void setUpdate(boolean authority)
authority
- true to set the data authority of update on;
false to set the data authority of update off.