|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Represents an entitlement or authorization to a access a set of Resources.
Specifically, classes that implement a Permission associate a
ResourcePattern, and zero or more actions on a matching
ResourceRequest and an AccessControlRule or a
SecurityDomain that controls access to the associated Resource.
Each Permission implementation has a "type", which is a String token used to associate the type of ResourceRequests that can match it. Rather than base the type entirely on the Java class implementing the Permission, use of a String token enables additional flexibility.
| Method Summary | |
AccessControlRule |
getAccessControlRule()
Get the AccessControlRule. |
String[] |
getActions()
Get the actions specified for this Permission. |
long |
getActionsMask()
Get an integer mask representing the actions being requested on the Resource. |
String |
getDescription()
Get a textual description. |
ResourcePattern |
getResourcePattern()
Get the ResourcePattern. |
ResourceType |
getResourceType()
Get the ResourceType. |
String |
getSecurityDomain()
Get the name of the SecurityDomain associated with this Permission. |
void |
initialize(Config config)
Initialize the Permission. |
boolean |
match(ResourceRequest resourceReq)
Determine if a ResourceRequest matches the ResourcePattern and one of the actions associated with this Permission. |
PermissionCollection |
newPermissionCollection()
Create a new PermissionCollection suitable for storing
homogeneous Permission instances. |
boolean |
overlaps(Permission permission)
Check for an overlapping Permission. |
void |
setAccessControlRule(AccessControlRule acr)
Set the AccessControlRule. |
void |
setActions(String[] actions)
Set the actions associated with this Permission. |
void |
setDescription(String desc)
Set a textual description. |
void |
setResourcePattern(ResourcePattern rp)
Set the ResourcePattern. |
void |
setSecurityDomain(String securityDomainName)
Set the name of the SecurityDomain associated with this Permission. |
| Methods inherited from interface java.lang.Comparable |
compareTo |
| Method Detail |
public void initialize(Config config)
throws ConfigException
config - a Config object that provides access to configuration
parameters and a runtime Context.
ConfigExceptionpublic ResourceType getResourceType()
public String getDescription()
public void setDescription(String desc)
desc - a textual description of the Permission.public ResourcePattern getResourcePattern()
ResourcePattern.
ResourcePattern associated with this
Permission.public void setResourcePattern(ResourcePattern rp)
rp - the ResourcePattern associated
with this Permission.public AccessControlRule getAccessControlRule()
AccessControlRule.
AccessControlRule that protects
Resources matching the
ResourcePattern.
If null, then another SecurityDomain (not the one
containing an instance of this Permission), must be associated
with the ResourcePattern.public void setAccessControlRule(AccessControlRule acr)
The
AccessControlRule protects Resources
matching the ResourcePattern. If null, then another
SecurityDomain (not the one containing an instance of
this Permission), must be associated with the
ResourcePattern so access control checks can be
delegated to that SecurityDomain.
acr - the AccessControlRule or null if another
SecurityDomain protects the Resources
associated with this Permission.
public String getSecurityDomain()
public void setSecurityDomain(String securityDomainName)
securityDomainName - the name of the SecurityDomain that owns
* resources matching this Permission.public String[] getActions()
public void setActions(String[] actions)
throws UnknownActionException
actions - a String array of actions
UnknownActionException - if one or more of the actions is
unknown for the type of resource associated with the permission.public long getActionsMask()
public boolean match(ResourceRequest resourceReq)
resourceReq - the ResourceRequest to be checked
against this Permission.
Resource matches the ResourcePattern
and one of the actions specified for this Permission.public PermissionCollection newPermissionCollection()
PermissionCollection suitable for storing
homogeneous Permission instances.
PermissionCollection suitable for storing a
collection of Permission instances of this class.public boolean overlaps(Permission permission)
Two Permission instances: A and B are considered to overlap if:
permission - the Permission to be checked for an overlap.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||