Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.services.qsys.objects
Class QSYSCheckUserAuthority

java.lang.Object
  extended by com.ibm.etools.iseries.services.qsys.objects.QSYSCheckUserAuthority

public class QSYSCheckUserAuthority
extends Object

This class uses the QSYCUSRA OS/400 api to check the authorities a user profile has to an object.


Field Summary
static String Copyright
           
 
Constructor Summary
QSYSCheckUserAuthority(AS400 as400, String userProfileName, String libName, String objName, String objType)
          Constructor
 
Method Summary
 boolean canRead()
          Find out if user has read authority to the file
 boolean canWrite()
          Find out if user has write authority to the file
 boolean checkAuthority(String authList)
          Check if the user profile has the specified authorities.
 AS400Message[] getMessages()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

QSYSCheckUserAuthority

public QSYSCheckUserAuthority(AS400 as400,
                              String userProfileName,
                              String libName,
                              String objName,
                              String objType)
Constructor

Parameters:
as400 - The iSeries system to check on
userProfileName - The user profile to check
libName - The library which contains the object to check
objName - The object to check
objType - The object type
Method Detail

canRead

public boolean canRead()
                throws Exception
Find out if user has read authority to the file

Returns:
true if user has read authority, false otherwise
Throws:
Exception

canWrite

public boolean canWrite()
                 throws Exception
Find out if user has write authority to the file

Returns:
true is user has write authority, false otherwise
Throws:
Exception

getMessages

public AS400Message[] getMessages()

checkAuthority

public boolean checkAuthority(String authList)
                       throws Exception
Check if the user profile has the specified authorities.

Parameters:
authList - The list of authorities to check. The authLis is all the authorities conncatenated together. Each authority must be 10 spaces (padded with blanks if required.) Therefore the lenght of authList must be a multiple of 10.
Returns:
true if the user has the specified authorities, false if the user profile does not have the specified authorities
Throws:
Exception

Rational Developer for Power Systems Software
V7.6

Copyright 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.