|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectARoad0.CNot.AccessControlLinkImpl
public final class AccessControlLinkImpl
This class is responsible for modeling the rights (and their justications) between two directly connected base objects. An access control link may be viewed as a set of rights with one or several types to say where they come from. The link state is defined by the gWork classes when they analyze the access paths in a view. The two base objects are not referenced in the access control link, but in the DisplayableLinkImpl class which manages a path of base objects and a list of access control links.
There are 20 link types, defined in the AccessControlLink interface. The link type value is typically true when there is a right which is defined for this link type, but the right is not always needed nor known when the value is true. The link type value may be true if it is a structural or pseudo-structural type, where there is a default static right or no right at all. However, the rights of all the types are managed in this class, except for the SPREAD type. Only the ACL and Privilege types may define negative rights, which are access forbiddings.
There are comments for each type link, and they may be set and ridden even when the link type value is false. Some comments are interpreted by the gWork package to display the access paths. They are AccessControlLink constants. Their roles are presented hereinafter:
- for GLOBAL, C_SECONDARY_GROUP tells it is a path link from an Actor to one of its secondary GroupID, with a context similar to the 'current account/group' context,
- for the OWNER and CONTAIN types, C_SET_USER, C_SET_GROUP and C_SET_USER_GROUP say that the AG context of execution is changed.
- for CONTAIN or GLOBAL, C_WEAK_LINK tells it is a path link from a GroupID without priority control from an UserID, and this produces a dashed-line arrow to display the access path in the view,
- for ACL and the Privilege types, C_CONTROL_OTHER_ACS tells an ACS controls another ACS, in the ACS views.
- the SPREAD comment is used to keep the summary of all the effective rights in the last AccessControlLink of each DisplayableLinkImpl. This is for the 'See Why' text. It is the responsibility of the method RightsFactory_Facade.getEffectiveRightsForPair().
- the GLOBAL comment is used to add the comment C_FIRST_RATE to drawn a double-with arrow in the view.
- the GLOBAL comment is used to add the comment C_COPIED_FROM_LINK to indicate, in the 'See Why' text, that some negative rights from other link(s) have been copied in this link.
There are 2 main methods to get a synthesis of all the rights in an AccessControlLink. The getRedondantRights method returns simply the concatenation of all the applicable rights, that is for all the activated link types. The getFilteredRights method returns also all the applicable rights, but it may provide a filtering of the negative and the positive rights, with some specific sets for the immutable rights.
Some AccessControlLinks are able to transfer the Account/Groups context. A first response is returned by the method isTransferingAGcontextWithoutACL(), that returns true when one of the following types is true: OWNER, CONTAIN, IS_MEMBER, IS_INDIRECT_MEMBER, HAS_VIRTUAL_MEMBER, IS_ALIAS, RUN_UNDER, SOFT_RUN_UNDER, LAUNCH. All the ACL provide such a transfert, in the generic algorithms. An ACS addon may change this behavior through its gWork.LinkRight implementation. This class is designed to provide fast methods for the gWork packages. The DisplayableLinkImpl constructors do not allow to add 2 objects that are equals. The equals() method is not implemented in this class.
AccessControlLink
,
DisplayableLinkImpl
Field Summary | |
---|---|
protected boolean |
acl_
|
protected java.lang.String |
aclComments_
|
protected boolean |
bridge_
|
protected java.lang.String |
bridgeComments_
|
protected boolean |
contain_
|
protected java.lang.String |
containComments_
|
protected boolean |
dataExchange_
|
protected java.lang.String |
dataExchangeComments_
|
protected boolean |
global_
|
protected java.lang.String |
globalComments_
|
protected boolean |
hasChild_
|
protected java.lang.String |
hasChildComments_
|
protected boolean |
hasVirtualMember_
|
protected java.lang.String |
hasVirtualMemberComments_
|
private static int |
INITIAL_CAPACITY
|
protected boolean |
isAlias_
|
protected java.lang.String |
isAliasComments_
|
protected boolean |
isIndirectMember_
|
protected java.lang.String |
isIndirectMemberComments_
|
protected boolean |
isMember_
|
protected java.lang.String |
isMemberComments_
|
protected StringRight[] |
l_aclRights_
|
protected StringRight[] |
l_bridgeRights_
|
protected StringRight[] |
l_containRights_
|
protected StringRight[] |
l_dataExchangeRights_
|
protected StringRight[] |
l_globalRights_
|
protected StringRight[] |
l_hasChildRights_
|
protected StringRight[] |
l_hasVirtualMemberRights_
|
protected StringRight[] |
l_isAliasRights_
|
protected StringRight[] |
l_isIndirectMemberRights_
|
protected StringRight[] |
l_isMemberRights_
|
protected StringRight[] |
l_launchRights_
|
protected StringRight[] |
l_linkedPrivRights_
|
protected StringRight[] |
l_negAclRights_
|
protected StringRight[] |
l_negLinkedPrivRights_
|
protected StringRight[] |
l_negTypedPrivRights_
|
protected StringRight[] |
l_ownerRights_
|
protected StringRight[] |
l_runUnderRights_
|
protected StringRight[] |
l_softRunUnderRights_
|
protected StringRight[] |
l_typedPrivRights_
|
protected boolean |
launch_
|
protected java.lang.String |
launchComments_
|
protected boolean |
linkedPriv_
|
protected java.lang.String |
linkedPrivComments_
|
protected boolean |
negAcl_
|
protected java.lang.String |
negAclComments_
|
protected boolean |
negLinkedPriv_
|
protected java.lang.String |
negLinkedPrivComments_
|
protected boolean |
negTypedPriv_
|
protected java.lang.String |
negTypedPrivComments_
|
protected boolean |
owner_
|
protected java.lang.String |
ownerComments_
|
private static int |
PRIME
|
protected boolean |
runUnder_
|
protected java.lang.String |
runUnderComments_
|
private static long |
serialVersionUID__
|
protected boolean |
softRunUnder_
|
protected java.lang.String |
softRunUnderComments_
|
protected boolean |
spread_
|
protected java.lang.String |
spreadComments_
|
protected boolean |
typedPriv_
|
protected java.lang.String |
typedPrivComments_
|
Fields inherited from interface ARoad0.CNot.AccessControlLink |
---|
ACL, BRIDGE, C_CONDITIONAL_ACL, C_CONTROL_OTHER_ACS, C_COPIED_FROM_LINK, C_FIRST_RATE, C_INHERITED_ACL, C_INHERITED_AG, C_INHERITED_PRI, C_MAY_SET_USER_GROUP, C_RECEIVE_ALIAS_RIGHTS, C_SECONDARY_GROUP, C_SET_GROUP, C_SET_USER, C_WEAK_LINK, CONTAIN, DATA_EXCHANGE, GLOBAL, HAS_CHILD, HAS_VIRTUAL_MEMBER, IS_ALIAS, IS_INDIRECT_MEMBER, IS_MEMBER, LAUNCH, LPRI, NEG_ACL, NEG_LPRI, NEG_TPRI, NO_LESS_COMPLIANCE, NO_MORE_COMPLIANCE, OWNER, RUN_UNDER, SOFT_RUN_UNDER, SPREAD, TPRI |
Constructor Summary | |
---|---|
AccessControlLinkImpl()
|
Method Summary | |
---|---|
void |
addComment(java.lang.String _linkType,
java.lang.String _comments)
Adds a new comment to the current comments associated to a link type, if it is not already there. |
boolean |
addRight(java.lang.String _linkType,
StringRight _right)
Adds a new right to the current rights associated to a link type, and activates the link type if it is false. |
void |
addRightsArray(java.lang.String _linkType,
StringRight[] _l_rights)
Adds the rights associated to one link type, and )activates the link type if necessary. |
java.lang.Object |
clone()
Gets a clone of the link. |
void |
finalizeForGui()
Sets the rights to null. |
java.lang.String |
getActivatedStrengthenTypes()
Gets the types (OWNER, IS_MEMBER, HAS_CHILD, IS_INDIRECT_MEMBER, IS_ALIAS, RUN_UNDER) if they are activated, without any rights. |
java.util.Set |
getAllComments()
Gets all the link type comments where the link type value is 'true'. |
java.util.Set |
getAllNegativeRights(boolean _withType)
Gets all the link type negative rights where the link type value is activated. |
static java.util.List<java.lang.String> |
getAllNegativeRightsTypes()
Called by setRights(). |
java.util.Set |
getAllPositiveRights(boolean _withType)
Gets all the positive rights for which the link type is activated. |
java.util.Set[] |
getFilteredRights(int _immutableRange,
boolean _withoutGroupInAGOrights,
boolean _withoutOtherInAGOrights)
Gets all the applicable rights, after a filtering of the negative and the positive rights, with some specific returned sets for the immutable rights. |
java.util.List<java.lang.String> |
getL_ActivatedPseudoStructuralTypes()
Gets the AccessControlLink types (OWNER, IS_MEMBER, HAS_CHILD, IS_INDIRECT_MEMBER, HAS_VIRTUAL_MEMBER, IS_ALIAS, RUN_UNDER, SOFT_RUN_UNDER, LAUNCH) if they are activated, without any rights. |
java.util.List<java.lang.String> |
getL_ActivatedStrengthenTypes()
Gets the AccessControlLink types (OWNER, IS_MEMBER, HAS_CHILD, IS_INDIRECT_MEMBER, IS_ALIAS, RUN_UNDER) if they are activated, without any rights. |
java.util.List<java.lang.String> |
getL_AllActivatedTypes()
Gets all the AccessControlLink types that are activated, without any rights. |
java.lang.String |
getLinkTypeComments(java.lang.String _linkType)
Gets the comments associated to one link type, if the link type value is true. |
boolean |
getLinkTypeValue(java.lang.String _linkType)
Gets the state of activation for one link type. |
java.util.Set |
getRedondantRights()
Gets all the link type rights where the link type value is activated. |
StringRight[] |
getRights(java.lang.String _linkType)
Gets the rights associated to one link type, if the link type value is true. |
long |
getSerialVersionUID()
|
int |
hashCode()
Gets some right hashcodes without including the rights, nor the comments. |
boolean |
isEmpty()
Processes the link type values only, not the comments nor the rights. |
boolean |
isFirstRateLink()
Called by GraphicEPRView.hasFirstRateLinkInOneDLink(). |
boolean |
isTransferingAGcontextWithoutACL()
The Account/Group context of a node may be transfered along the next nodes of a DisplayableLinkImpl if the next AccessControlLinks are activated for some given types. |
boolean |
isTrueForOneAclLinkType()
Called by Linux and CompoundRightsFactoryImpl. |
boolean |
isTrueForOneLinkType()
NO USE. |
boolean |
isTrueForOneNegativeLinkType()
Called by RightsFactory_Facade.getEffectiveRightsForPair().. |
boolean |
isTrueForOnePseudoStructuralLinkType()
Gets the state of activation for (OWNER, IS_MEMBER, HAS_CHILD, IS_INDIRECT_MEMBER, HAS_VIRTUAL_MEMBER, IS_ALIAS, RUN_UNDER, LAUNCH). |
boolean |
isTrueForOneStrengthenLinkType()
Gets the state of activation for (OWNER, IS_MEMBER, HAS_CHILD, IS_INDIRECT_MEMBER, IS_ALIAS, RUN_UNDER). |
boolean |
isTrueForOneStructuralLinkType()
Gets the state of activation for (IS_MEMBER, HAS_CHILD, IS_INDIRECT_MEMBER, IS_ALIAS). |
boolean |
isTrueForOwnerOrContainLinkType()
Called by DisplayableLinkImpl.containsOwnerContainLinkTypes() and LinuxRightsFactoryImpl.addOtherRights()/detectOtherRights(). |
boolean |
isWeak()
True if this is the first link of a DisplayableLink from a GroupID to a Resource, to say that the effective rights depend on the AGO rights Actor which uses the link to this GroupID, and so this is a weak DisplayableLink. |
boolean |
mergeAccessControlLinkWithoutFiltering(AccessControlLinkImpl _acLink)
Adds all the argument rights and comments in the rights and comments of this instance, for each activated type in the argument. |
void |
mergeCommentsWithoutFiltering(AccessControlLinkImpl _acLink)
Adds all the argument comments to this instance comments, whatever the link type value in the argument and this instance. |
void |
mergeRightsForOneLinkType(java.lang.String _linkType,
StringRight[] _l_rights)
NO USE. |
void |
removeComment(java.lang.String _linkType,
java.lang.String _comments)
Removes all the instances of the comments associated to one link type if they exist. |
void |
removeRight(java.lang.String _linkType,
StringRight _right)
Removes a right associated to one link type if it exists, and desactivates the link type if it is the last right. |
void |
setEmpty()
Sets the link type values to false, the rights to null and the comments to empty values. |
void |
setLinkTypeComments(java.lang.String _linkType,
java.lang.String _comments)
Sets the comments associated to one link type, whatever the link type value. |
void |
setLinkTypesWithoutFiltering(AccessControlLinkImpl _acLink)
Sets all the link types with the _acLink link types. |
void |
setLinkTypeToFalse(java.lang.String _linkType)
Desactivates a link type. |
void |
setLinkTypeToTrue(java.lang.String _linkType)
Activates a link type. |
void |
setRights(java.lang.String _linkType,
StringRight[] _rights)
Sets the rights associated to one link type, and (des)activates the link type. |
java.lang.String |
toSeeWhyText()
Returns the comments for all the type link values which are true, but not the rights. |
java.lang.String |
toString()
Returns the comments for all the type link values which are true, but not the rights. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID__
private static final int PRIME
private static final int INITIAL_CAPACITY
protected boolean global_
protected boolean bridge_
protected boolean acl_
protected boolean negAcl_
protected boolean owner_
protected boolean contain_
protected boolean spread_
protected boolean isMember_
protected boolean hasChild_
protected boolean isIndirectMember_
protected boolean hasVirtualMember_
protected boolean typedPriv_
protected boolean negTypedPriv_
protected boolean linkedPriv_
protected boolean negLinkedPriv_
protected boolean isAlias_
protected boolean runUnder_
protected boolean softRunUnder_
protected boolean dataExchange_
protected boolean launch_
protected StringRight[] l_globalRights_
protected StringRight[] l_bridgeRights_
protected StringRight[] l_aclRights_
protected StringRight[] l_negAclRights_
protected StringRight[] l_ownerRights_
protected StringRight[] l_containRights_
protected StringRight[] l_isMemberRights_
protected StringRight[] l_hasChildRights_
protected StringRight[] l_isIndirectMemberRights_
protected StringRight[] l_hasVirtualMemberRights_
protected StringRight[] l_typedPrivRights_
protected StringRight[] l_negTypedPrivRights_
protected StringRight[] l_linkedPrivRights_
protected StringRight[] l_negLinkedPrivRights_
protected StringRight[] l_isAliasRights_
protected StringRight[] l_runUnderRights_
protected StringRight[] l_softRunUnderRights_
protected StringRight[] l_dataExchangeRights_
protected StringRight[] l_launchRights_
protected java.lang.String globalComments_
protected java.lang.String bridgeComments_
protected java.lang.String aclComments_
protected java.lang.String negAclComments_
protected java.lang.String ownerComments_
protected java.lang.String containComments_
protected java.lang.String spreadComments_
protected java.lang.String isMemberComments_
protected java.lang.String hasChildComments_
protected java.lang.String isIndirectMemberComments_
protected java.lang.String hasVirtualMemberComments_
protected java.lang.String typedPrivComments_
protected java.lang.String negTypedPrivComments_
protected java.lang.String linkedPrivComments_
protected java.lang.String negLinkedPrivComments_
protected java.lang.String isAliasComments_
protected java.lang.String runUnderComments_
protected java.lang.String softRunUnderComments_
protected java.lang.String dataExchangeComments_
protected java.lang.String launchComments_
Constructor Detail |
---|
public AccessControlLinkImpl()
Method Detail |
---|
public static java.util.List<java.lang.String> getAllNegativeRightsTypes()
public void setLinkTypeToTrue(java.lang.String _linkType)
_linkType
- link type in AccessControlLinkfor the list of the link types
public void setLinkTypeToFalse(java.lang.String _linkType)
_linkType
- is a link type in AccessControlLinkfor link types
public boolean getLinkTypeValue(java.lang.String _linkType)
_linkType
- is a link type in AccessControlLink
for link types
public boolean isTrueForOneLinkType()
public boolean isTrueForOneAclLinkType()
public boolean isTrueForOneNegativeLinkType()
public boolean isFirstRateLink()
- in the generic access path search, if there is a negative-right path (A to B) while there are two paths (A to C) and (C to B) which have positive rights, the path (A to B) is set as 'first-rate' to say the negative right is a prioritary one, and A cannot access to B through C.
- outside the generic access path search, in any AcsAddon where specific priorities are managed, like in the MySQL server AcsAddon.
public boolean isTrueForOwnerOrContainLinkType()
public boolean isTrueForOnePseudoStructuralLinkType()
public boolean isTrueForOneStructuralLinkType()
public boolean isTrueForOneStrengthenLinkType()
public boolean isTransferingAGcontextWithoutACL()
LinkRightsImpl.isTransferingAGcontext(ARoad0.CNot.AccessControlLinkImpl, ARoad0.gBaseInterface.ImmutableACS, ARoad0.gBaseInterface.ImmutableACS)
public java.util.Set getRedondantRights()
for link types
public java.util.Set[] getFilteredRights(int _immutableRange, boolean _withoutGroupInAGOrights, boolean _withoutOtherInAGOrights)
_immutableRange
- is 0 if there is no right to put in the two immutable sets (unused), 1 if only owner rights are to put in the two immutable sets,
2 if owner and structural rights are to be get as immutable (unused),
3 if owner, structural, bridge and data_exchange rights are to be get as immutable (unused).
_withoutGroupInAGOrights
- true if the CONTAIN rights are not returned,
and false to return it_withoutOtherInAGOrights
- true if the 'Other rights' in AGO rights
are not returned, and false to return it.
public java.lang.String getActivatedStrengthenTypes()
for the link types
public java.util.List<java.lang.String> getL_ActivatedStrengthenTypes()
for the link types
public java.util.List<java.lang.String> getL_ActivatedPseudoStructuralTypes()
for the link types
public java.util.List<java.lang.String> getL_AllActivatedTypes()
for the link types
public java.util.Set getAllPositiveRights(boolean _withType)
_withType
- true to have the link type at the beginning of the rights list
for each type, in the returned Set
for link types
public java.util.Set getAllNegativeRights(boolean _withType)
_withType
- true to have the link type at the beginning of the rights list
for each type, in the returned Set
for link types
public java.util.Set getAllComments()
for link types
public StringRight[] getRights(java.lang.String _linkType)
_linkType
- is a link type in AccessControlLink
for link types
public java.lang.String getLinkTypeComments(java.lang.String _linkType)
_linkType
- is a link type in AccessControlLink. If not, return "".
for link types
public void setLinkTypeComments(java.lang.String _linkType, java.lang.String _comments)
_linkType
- is a link type in AccessControlLink_comments
- may be ""for link types
public void addRightsArray(java.lang.String _linkType, StringRight[] _l_rights)
_linkType
- is a link type in AccessControlLink, excepted SPREAD_l_rights
- may be null, new StringRight[0], or an array of non-null elements.
java.lang.InternalError
- if the sens of a right does not comply to the link type policy,
or if SPREAD is the link typefor link types
public void setRights(java.lang.String _linkType, StringRight[] _rights)
_linkType
- is a link type in AccessControlLink, excepted SPREAD_rights
- may be null, new StringRight[0], or an array of non-null elements.
java.lang.InternalError
- if the sens of a right does not comply to the link type policy,
or if SPREAD is the link typefor link types
public void mergeRightsForOneLinkType(java.lang.String _linkType, StringRight[] _l_rights)
_linkType
- is a link type in AccessControlLink._l_rights
- are the rights to add. May be empty, but not null.for link types
public boolean addRight(java.lang.String _linkType, StringRight _right)
_linkType
- is a link type in AccessControlLink_right
- to add
for link types
public void addComment(java.lang.String _linkType, java.lang.String _comments)
_linkType
- is a link type in AccessControlLink_comments
- to addfor link types
public void removeRight(java.lang.String _linkType, StringRight _right)
_linkType
- is a link type in AccessControlLink_right
- to removefor link types
public void removeComment(java.lang.String _linkType, java.lang.String _comments)
_linkType
- is a link type in AccessControlLink;
No action if _linkType is not a link type, if _commenst is unknown._comments
- to remove one or several times; no action if null or empty.for link types
public boolean mergeAccessControlLinkWithoutFiltering(AccessControlLinkImpl _acLink)
_acLink
- to merge
public void mergeCommentsWithoutFiltering(AccessControlLinkImpl _acLink)
_acLink
- a link with comments to put in this linkpublic void setLinkTypesWithoutFiltering(AccessControlLinkImpl _acLink)
_acLink
- is an AccessControlLinkImpl to copypublic boolean isWeak()
public boolean isEmpty()
public java.lang.Object clone()
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public int hashCode()
hashCode
in class java.lang.Object
public void finalizeForGui()
public void setEmpty()
public long getSerialVersionUID()
public java.lang.String toSeeWhyText()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |