Class SAFPermission
- java.lang.Object
-
- java.security.Permission
-
- com.ibm.security.auth.SAFPermission
-
- All Implemented Interfaces:
- java.io.Serializable, java.security.Guard
public final class SAFPermission extends java.security.Permission implements java.io.SerializableThe SAFPermission class extends the Permission class. These permissions will be used for a permission check in RACF.The SAF Permission take three instance variables: securityClass : The name of the RACF class of resources (1-8 characters) and is ??optional?? entityName : Specifies the name of the resource (1-246 characters) and is required. access : Specifies a numeric value that identifies the type of access to check for and is optional. The name string (inherited from Permission is the entityName. The securityClass string will be added as a private String. The access integer will be added as private Integer.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.Integer__ALTER_RESOURCEstatic java.lang.Integer__CONTROL_RESOURCEstatic java.lang.Integer__READ_RESOURCEstatic java.lang.Integer__UPDATE_RESOURCE
-
Constructor Summary
Constructors Constructor and Description SAFPermission(java.lang.String entityName)Creates a new SAFPermission with the specified entity _name and default values for securityClass and access.SAFPermission(java.lang.String entityName, java.lang.Integer access)Creates a new SAFPermission with the specified entityName and access with a default security class of ????SAFPermission(java.lang.String securityClass, java.lang.String entityName)Creates a new SAFPermission with the specified securityClass, and entityName with a defaulted access of READ.SAFPermission(java.lang.String securityClass, java.lang.String entityName, java.lang.Integer access)Creates a new SAFPermission with the specified securityClass, entityName and access.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)Checks two SAFPermission objects for equality.java.lang.IntegergetAccess()Returns the Access for this object.java.lang.StringgetActions()Returns the Actions value for this object.java.lang.StringgetSecurityClass()Returns the Security Class for this object from this class.inthashCode()Returns the hash code value for this object.booleanimplies(java.security.Permission p)Calls RACF to verify the permission.java.security.PermissionCollectionnewPermissionCollection()Returns a new PermissionCollection object for storing SAFPermission objects.java.lang.StringtoString()Returns the a String that is a concatenation of the securityClass, the name and the access.
-
-
-
Field Detail
-
__READ_RESOURCE
public static final java.lang.Integer __READ_RESOURCE
-
__UPDATE_RESOURCE
public static final java.lang.Integer __UPDATE_RESOURCE
-
__CONTROL_RESOURCE
public static final java.lang.Integer __CONTROL_RESOURCE
-
__ALTER_RESOURCE
public static final java.lang.Integer __ALTER_RESOURCE
-
-
Constructor Detail
-
SAFPermission
public SAFPermission(java.lang.String securityClass, java.lang.String entityName, java.lang.Integer access)Creates a new SAFPermission with the specified securityClass, entityName and access.- Parameters:
entityName- the entityName of the SAFPermission.securityClass- the securityClass of the SAFPermission.access- the access of the SAFPermission.- Throws:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
SAFPermission
public SAFPermission(java.lang.String securityClass, java.lang.String entityName)Creates a new SAFPermission with the specified securityClass, and entityName with a defaulted access of READ.- Parameters:
entityName- the entityName of the SAFPermission.securityClass- the securityClass of the SAFPermission.- Throws:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
SAFPermission
public SAFPermission(java.lang.String entityName, java.lang.Integer access)Creates a new SAFPermission with the specified entityName and access with a default security class of ????- Parameters:
entityName- the entityName of the SAFPermission.access- the access of the SAFPermission.- Throws:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
SAFPermission
public SAFPermission(java.lang.String entityName)
Creates a new SAFPermission with the specified entity _name and default values for securityClass and access.- Parameters:
entityName- the entityName of the SAFPermission.- Throws:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
-
Method Detail
-
implies
public boolean implies(java.security.Permission p)
Calls RACF to verify the permission.More specifically, this method returns true if:
RACF returns that the user has the necessary access or false if not.
- Specified by:
impliesin classjava.security.Permission- Parameters:
p- used to make the check permission call.- Returns:
- true if RACF allows the access, false otherwise.
-
equals
public boolean equals(java.lang.Object obj)
Checks two SAFPermission objects for equality. Checks that obj's class is the same as this object's class and has the same name as this object.- Specified by:
equalsin classjava.security.Permission- Parameters:
obj- the object we are testing for equality with this object.- Returns:
- true if obj is a SAFPermission, and has the same name as this SAFPermission object, false otherwise.
-
hashCode
public int hashCode()
Returns the hash code value for this object. The hash code used is the hash code of the name, that is,toString().hashCode(), wheregetNameis from the Permission superclass.- Specified by:
hashCodein classjava.security.Permission- Returns:
- a hash code value for this object.
-
getActions
public java.lang.String getActions()
Returns the Actions value for this object. The Actions are not relevant for a SAFPermission,- Specified by:
getActionsin classjava.security.Permission- Returns:
- Actions for this object.
-
getSecurityClass
public java.lang.String getSecurityClass()
Returns the Security Class for this object from this class.- Returns:
- a String for the value of securityClass for this object.
-
getAccess
public java.lang.Integer getAccess()
Returns the Access for this object. from this class.- Returns:
- a String for the value of access for this object.
-
toString
public java.lang.String toString()
Returns the a String that is a concatenation of the securityClass, the name and the access. This is used for the hashcode.- Overrides:
toStringin classjava.security.Permission- Returns:
- a String for the value for this object.
-
newPermissionCollection
public java.security.PermissionCollection newPermissionCollection()
Returns a new PermissionCollection object for storing SAFPermission objects.A SAFPermissionCollection stores a collection of SAFPermission permissions.
SAFPermission objects must be stored in a manner that allows them to be inserted in any order, but that also enables the PermissionCollection
impliesmethod to be implemented in an efficient (and consistent) manner.- Overrides:
newPermissionCollectionin classjava.security.Permission- Returns:
- a new PermissionCollection object suitable for storing SAFPermissions.
-
-