|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.Permission
The Permission class is provided to retrieve user's authority to
an object.
To improve performance, the Permission object caches authority changes
until the commit() method is called. When commit()is called,
all changes up to that point are sent to the AS/400.
The permission of an object is a collection of many users' authority to that object,
and the UserPermission class is used to represent a user's authority to a object.
Because there are three kinds of object in the AS/400, three subclasses of UserPermission
are defined:
AS400 as400 = new AS400(); Permission permission = new Permission(as400,"/QSYS.LIB/QJAVA.LIB"); permission.addAuthorizedUser("user1"); QSYSPermission userPermission = permission.getUserPermission("user1"); userPermission.setObjectAuthority("*CHANGE"); permission.commit();
UserPermission
,
DLOPermission
,
QSYSPermission
,
RootPermission
, Serialized FormField Summary | |
static int |
TYPE_DLO
Constant indicating the object is a Document Library Objects (DLO) stored in QDLS. |
static int |
TYPE_QSYS
Constant indicating the object is contained in the AS/400 library structure and stored in QSYS.LIB. |
static int |
TYPE_ROOT
Constant indicating that the object is contained in the root directory structure. |
Constructor Summary | |
Permission(AS400 as400,
java.lang.String fileName)
Constructs a Permission object. |
|
Permission(IFSFile file)
Constructs a Permission object. |
Method Summary | |
void |
addAuthorizedUser(java.lang.String userProfileName)
Adds an authorized user. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener. |
void |
addUserPermission(UserPermission userPermission)
Adds a user permission. |
void |
commit()
Commits the permission changes to the AS/400 system. |
java.lang.String |
getAuthorizationList()
Returns the authorizations list of the object. |
java.util.Enumeration |
getAuthorizedUsers()
Returns an enumeration of authorized users. |
java.lang.String |
getName()
Returns the name of the object whose permission is represented by this object. |
java.lang.String |
getObjectPath()
Returns the path of the integrated file system object whose permission is represented by this object. |
java.lang.String |
getOwner()
Returns the object owner. |
java.lang.String |
getPrimaryGroup()
Returns the primary group of the object. |
int |
getSensitivityLevel()
Returns the sensitivity level of the object. |
AS400 |
getSystem()
Returns the AS/400 system |
int |
getType()
Returns the object type. |
UserPermission |
getUserPermission(java.lang.String userProfileName)
Returns the specific Permission object. |
java.util.Enumeration |
getUserPermissions()
Returns an enumeration of Permission object. |
boolean |
isCommitted()
Returns a flag indicating whether the change has been committed. |
void |
removeAuthorizedUser(java.lang.String userProfileName)
Removes an authorized user. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener. |
void |
removeUserPermission(UserPermission permission)
Removes a user permission. |
void |
setAuthorizationList(java.lang.String autList)
Sets the authorizations list of the object. |
void |
setSensitivityLevel(int sensitivityLevel)
Sets the sensitivity level of the object. |
void |
setSystem(AS400 system)
Sets the system where system value is retrieved. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int TYPE_DLO
public static final int TYPE_QSYS
public static final int TYPE_ROOT
Constructor Detail |
public Permission(IFSFile file) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, java.io.UnsupportedEncodingException
file
- The IFSFile object. For example, The IFSFile object which represents the object "QSYS.LIB/FRED.LIB".public Permission(AS400 as400, java.lang.String fileName) throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, java.io.UnsupportedEncodingException
system
- The AS/400 system.fileName
- The full path of the object. For example, "/QSYS.LIB/FRED.LIB".Method Detail |
public void addAuthorizedUser(java.lang.String userProfileName)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The property change listener to add.public void addUserPermission(UserPermission userPermission)
userPermission
- The UserPermission object.public void commit() throws AS400Exception, AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, java.lang.InterruptedException, java.io.IOException, ObjectDoesNotExistException, ServerStartupException
public java.lang.String getAuthorizationList()
setAuthorizationList(String)
public java.util.Enumeration getAuthorizedUsers()
public java.lang.String getObjectPath()
public java.lang.String getName()
public java.lang.String getOwner()
public java.lang.String getPrimaryGroup()
public int getSensitivityLevel()
setSensitivityLevel(int)
public AS400 getSystem()
public int getType()
public UserPermission getUserPermission(java.lang.String userProfileName)
userProfileName
- The name of the user profile.public java.util.Enumeration getUserPermissions()
public boolean isCommitted()
public void removeAuthorizedUser(java.lang.String userProfileName)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The property change listener to remove.public void removeUserPermission(UserPermission permission)
public void setAuthorizationList(java.lang.String autList)
Permission permisson = new Permisson(new AS400(),"/QSYS.LIB/FRED.LIB"; permission.setAuthorizatinList("testautl"); System.out.println("The authorization list of fred.lib is " + permissin.geAuthorizationList(); permission.setAuthorizatinList("*NONE"); System.out.println("The authorization list of fred.lib is " + permissin.geAuthorizationList();
authorizationList
- The authorizations list of the object.public void setSensitivityLevel(int sensitivityLevel)
sensitivityLevel
- The sensitivity level of the object.The
possible values :
getSensitivityLevel()
public void setSystem(AS400 system)
system
- The AS/400 system object.getSystem()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |