|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openpermis.policy.bean.basic.BasicPart
org.openpermis.policy.bean.basic.BasicPartBean
org.openpermis.policy.bean.basic.BasicRoleAssignmentRule
public class BasicRoleAssignmentRule
A rule for assigning roles to subjects.
Constructor Summary | |
---|---|
protected |
BasicRoleAssignmentRule(SerialNumber serialNumber,
AuthorityBean authority,
DomainBean subjectDomain,
Collection<Role> roles,
TimePeriodConstraint constraint,
int delegationDepth)
Creates a role assignment rule. |
Method Summary | |
---|---|
protected void |
appendPartDetails(StringBuilder sb)
Appends the details of this extended part for the string representation of this part. |
protected boolean |
comparablePart(BasicPart part)
Check if the part specified is comparable to this part. |
protected boolean |
equalPart(BasicPart part)
Compares another part to this part. |
PartBean |
findBySerialNumber(SerialNumber partSerialNumber)
Returns the part bean corresponding to the specified serial number. The basic implementation returns this bean if its serial number matches the one passed in or null if not. |
AuthorityBean |
getAuthority()
Returns the authorising subject of this rule. |
TimePeriodConstraint |
getConstraint()
Returns the time constraint of this rule. |
int |
getDelegationDepth()
Returns the delegation depth of this rule. |
RoleCollection |
getRoles()
Returns the set of roles of this rule. |
protected String |
getSimpleClassName()
Returns the simple implementation class name of this class. |
DomainBean |
getSubjectDomain()
Returns the subject domain to which this rule applies. |
boolean |
isPartValid(PartProblemReporter reporter)
Checks if the extended state of this part is valid. |
protected int |
partHashCode()
Returns the hash code of the extended part state. |
void |
setAuthority(AuthorityBean authority)
Sets the authorising subject of this rule. |
void |
setConstraint(TimePeriodConstraint constraint)
Sets the time constraint of this rule. |
void |
setDelegationDepth(int delegationDepth)
Sets the delegation depth of this rule. |
void |
setRoles(RoleCollection roles)
Sets the roles of this rule. |
void |
setSubjectDomain(DomainBean subjectDomain)
Sets the subject domain to which this rule applies. |
Set<Role> |
verifyRoleAssignment(Subject subject,
Set<Role> assertedRoles,
TimeStamp timeStamp)
Verifies the assignment of the given roles to the given subject according to this rule, using the clock. |
Methods inherited from class org.openpermis.policy.bean.basic.BasicPartBean |
---|
addPropertyChangeListener, equalSerialNumber, firePropertyChange, getPartBeanType, getSerialNumber, getSerialNumberString, notifyIdentityChange, notifyNameChange, removePropertyChangeListener, toShortString |
Methods inherited from class org.openpermis.policy.bean.basic.BasicPart |
---|
appendDetails, equals, getIdentity, getName, hashCode, hasPartIdentity, hasPartName, isChildCollectionValid, isChildNotNull, isChildNullOrValid, isChildValid, isIdentityValid, isNameValid, isValid, reportProblem, setIdentity, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.openpermis.policy.Part |
---|
equals, hashCode, isValid, toString |
Methods inherited from interface org.openpermis.policy.bean.PartBean |
---|
addPropertyChangeListener, equalSerialNumber, getPartBeanType, getSerialNumber, removePropertyChangeListener, toShortString |
Methods inherited from interface org.openpermis.policy.Part |
---|
equals, hashCode, isValid, toString |
Constructor Detail |
---|
protected BasicRoleAssignmentRule(SerialNumber serialNumber, AuthorityBean authority, DomainBean subjectDomain, Collection<Role> roles, TimePeriodConstraint constraint, int delegationDepth)
serialNumber
- the serial number of this part.authority
- the AuthorityBean
authorizing the role assignment.subjectDomain
- the Domain
to which the rule applies.roles
- the roles
that subjects are allowed to assign.delegationDepth
- the delegation depth that applies.Method Detail |
---|
public Set<Role> verifyRoleAssignment(Subject subject, Set<Role> assertedRoles, TimeStamp timeStamp)
RoleAssignmentRule
verifyRoleAssignment
in interface RoleAssignmentRule
subject
- a Subject
.assertedRoles
- a set of Role
s.timeStamp
- a TimeStamp
.
public AuthorityBean getAuthority()
RoleAssignmentRuleBean
getAuthority
in interface RoleAssignmentRuleBean
AuthorityBean
of this rule.public void setAuthority(AuthorityBean authority)
RoleAssignmentRuleBean
setAuthority
in interface RoleAssignmentRuleBean
authority
- the new authorising AuthorityBean
of this rule.public DomainBean getSubjectDomain()
RoleAssignmentRuleBean
getSubjectDomain
in interface RoleAssignmentRuleBean
DomainBean
.public void setSubjectDomain(DomainBean subjectDomain)
RoleAssignmentRuleBean
setSubjectDomain
in interface RoleAssignmentRuleBean
subjectDomain
- the rule's new DomainBean
.public int getDelegationDepth()
RoleAssignmentRuleBean
getDelegationDepth
in interface RoleAssignmentRuleBean
public void setDelegationDepth(int delegationDepth)
RoleAssignmentRuleBean
setDelegationDepth
in interface RoleAssignmentRuleBean
delegationDepth
- the rule's new depth.public RoleCollection getRoles()
RoleAssignmentRuleBean
getRoles
in interface RoleAssignmentRuleBean
public void setRoles(RoleCollection roles)
RoleAssignmentRuleBean
setRoles
in interface RoleAssignmentRuleBean
roles
- the new roles of this rule.public TimePeriodConstraint getConstraint()
RoleAssignmentRuleBean
getConstraint
in interface RoleAssignmentRuleBean
public void setConstraint(TimePeriodConstraint constraint)
RoleAssignmentRuleBean
setConstraint
in interface RoleAssignmentRuleBean
constraint
- a TimePeriodConstraint
.public boolean isPartValid(PartProblemReporter reporter)
BasicPart
isPartValid
in class BasicPart
reporter
- the problem reporter to use, may be null
.BasicPart
,
Part.isValid(PartProblemReporter)
,
BasicPart.reportProblem(org.openpermis.policy.PartProblemReporter, org.openpermis.policy.PartProblemReporter.ProblemMessage, java.lang.Object...)
protected boolean comparablePart(BasicPart part)
BasicPart
comparablePart
in class BasicPart
part
- the part to check.
true
if the part supplied is comparable to this part.BasicPart
protected boolean equalPart(BasicPart part)
BasicPart
equalPart
in class BasicPart
part
- the part to compare to this part.
true
if the part supplied is considered equivalent to this part.BasicUtilities.equalObjects(Object, Object)
,
BasicPart
protected int partHashCode()
BasicPart
partHashCode
in class BasicPart
BasicPart
,
BasicUtilities.multiHashCode(int...)
protected String getSimpleClassName()
BasicPart
If your implementation represents an interface implementation return the interface
simple class name here. In short: return the instance you are checking against in
BasicPart.comparablePart(BasicPart)
.
getSimpleClassName
in class BasicPart
protected void appendPartDetails(StringBuilder sb)
BasicPart
appendPartDetails
in class BasicPart
sb
- the string builder to add the details to.BasicPart
,
BasicPart.appendDetails(StringBuilder, String, Object)
public PartBean findBySerialNumber(SerialNumber partSerialNumber)
BasicPartBean
If the part bean contains other part beans, it searches its child beans recursively.
The basic implementation returns this bean if its serial number matches
the one passed in or null
if not. Subclasses that contain other
parts must traverse their children.
findBySerialNumber
in interface PartBean
findBySerialNumber
in class BasicPartBean
partSerialNumber
- the SerialNumber
of the part bean to return.
PartBean
or null
if no
matching part bean is found.
|
![]() |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:14:49
Copyright (c) 2002-2007 Ergon Informatik AG