|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.platform.security.api.AuthorizationPermission
public abstract class AuthorizationPermission
An authorization permission defines access permissions for a particular resource. A rule determines what action or actions can be performed on a resource, and is comprised of the resource, the actions allowed, and an optional content modifier (which defines an additional criteria that is to be placed upon the usage of the resource).
Field Summary | |
---|---|
static AuthorizationActions |
DEFAULT_ACTIONS
The default action for rules is NONE. |
protected int |
hashCode
The cached value of the hash code for this object. |
protected int |
PRIME
|
protected AuthorizationResource |
resource
The resource of this permission; generally the name of the resource to which this rule applies. |
Constructor Summary | |
---|---|
protected |
AuthorizationPermission(AuthorizationResource resource,
AuthorizationRealm realm,
AuthorizationActions actions,
java.lang.String factoryClassName)
Create a new authorization rule for the specified resource. |
protected |
AuthorizationPermission(AuthorizationResource resource,
AuthorizationRealm realm,
AuthorizationActions actions,
java.lang.String contentModifier,
java.lang.String factoryClassName)
Create a new authorization rule for the specified resource. |
protected |
AuthorizationPermission(AuthorizationResource resource,
AuthorizationRealm realm,
java.lang.String factoryClassName)
Create a new authorization rule for the specified resource. |
Method Summary | |
---|---|
protected abstract java.lang.Object |
clone()
Make a deep copy of this object. |
static int |
compare(AuthorizationPermission obj1,
AuthorizationPermission obj2)
Utility method to compare two AuthorizationPermission instances. |
int |
compareTo(java.lang.Object o)
Compares this AuthorizationPermission to another Object. |
boolean |
equals(java.lang.Object obj)
Returns true if the specified object is semantically equal to this instance. |
AuthorizationActions |
getActions()
Get the operations that the user may perform on the resource, as defined by this rule. |
java.lang.String |
getContentModifier()
Get the content modifier for this rule. |
java.lang.String |
getFactoryClassName()
Obtain the name of the factory class for this rule. |
AuthorizationRealm |
getRealm()
Get the AuthorizationRealm in which this permission belongs. |
java.lang.String |
getRealmName()
Get the name of the realm in which this permission belongs. |
AuthorizationResource |
getResource()
Obtain the resource object for this rule. |
java.lang.String |
getResourceName()
Obtain the name of the resource for this rule. |
boolean |
hasContentModifier()
Determine whether this rule has a content modifier that should be used upon access to the resource. |
int |
hashCode()
Overrides Object hashCode method. |
abstract boolean |
implies(AuthorizationPermission resource)
Checks if the specified resource is ipmlied by this resource instance. |
boolean |
resourceIsRecursive()
Determin if this permission applies to all subnode resources. |
java.lang.String |
toString()
Returns a string representing the current state of the object. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final AuthorizationActions DEFAULT_ACTIONS
protected AuthorizationResource resource
protected int hashCode
protected int PRIME
Constructor Detail |
---|
protected AuthorizationPermission(AuthorizationResource resource, AuthorizationRealm realm, AuthorizationActions actions, java.lang.String contentModifier, java.lang.String factoryClassName)
resource
- the resource to which this permission applies.realm
- the name of the realm for this rule (may not be null, but may be empty)actions
- the actions to apply to the resourcecontentModifier
- the content modifier (may be null)factoryClassName
- The factory class name that can instantiate this permission (may not be null)protected AuthorizationPermission(AuthorizationResource resource, AuthorizationRealm realm, java.lang.String factoryClassName)
resource
- The new resourcerealm
- the name of the realm for this rule (may not be null, but may be empty)factoryClassName
- The factory class name that can instantiate this permission (may not be null)protected AuthorizationPermission(AuthorizationResource resource, AuthorizationRealm realm, AuthorizationActions actions, java.lang.String factoryClassName)
resource
- The new resourcerealm
- the name of the realm for this rule (may not be null, but may be empty)actions
- the actions for the resourcefactoryClassName
- The factory class name that can instantiate this permission (may not be null)Method Detail |
---|
protected abstract java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public java.lang.String getFactoryClassName()
public boolean resourceIsRecursive()
true
if this permission's resource is a node in
a subtree and the allowed Action applies to all subnodes, false
otherwise.public java.lang.String getResourceName()
public AuthorizationResource getResource()
public boolean hasContentModifier()
public java.lang.String getContentModifier()
public java.lang.String getRealmName()
public AuthorizationRealm getRealm()
AuthorizationRealm
in which this permission belongs.
public AuthorizationActions getActions()
public abstract boolean implies(AuthorizationPermission resource)
resource
- the AuthorizationPermission instance to be checked
java.lang.IllegalArgumentException
- if the specified resource is null or incomplete.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
,
Object.equals(Object)
public boolean equals(java.lang.Object obj)
compareTo()
.
equals
in class java.lang.Object
obj
- the object that this instance is to be compared to.
public int compareTo(java.lang.Object o) throws java.lang.ClassCastException
equals()
.
compareTo
in interface java.lang.Comparable
o
- the object that this instance is to be compared to.
java.lang.ClassCastException
- if the specified object's type prevents it
from being compared to this AuthorizationPermission.public static final int compare(AuthorizationPermission obj1, AuthorizationPermission obj2)
Subclasses may not override this method because it is designed to enforce a
constraint placed on AuthorizationPermission
s.
This method assumes that all type-checking has already been performed.
obj1
- the first policyID to be comparedobj2
- the second policyID to be compared
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |