Package org.xwiki.security
Class SecurityReference
- java.lang.Object
-
- org.xwiki.model.reference.EntityReference
-
- org.xwiki.security.SecurityReference
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<EntityReference>
- Direct Known Subclasses:
UserSecurityReference
public class SecurityReference extends EntityReference
SecurityReference is a variant of EntityReference used internally in the security-authorization module, for the purpose of conveniently maintaining a hierarchy where all entities are rooted by the main wiki. This form of hierarchical view is required to deciding which access levels that should be enforced. There is always a one-to-one correspondence between a SecurityReference and a Wiki-, Space-, or DocumentReference. Moreover, a security reference built with a null EntityReference is equivalent to the main wiki reference (but with a null original reference).- Since:
- 4.0M2
- Version:
- $Id: cd6333d38cd7f0c1ee161bcb208ff7d9f7ae2ca5 $
- See Also:
SecurityReferenceFactory
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static EntityType
FARM
EntityType for the main wiki.protected SecurityReference
mainWikiReference
Main wiki reference.-
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
-
-
Method Summary
-
Methods inherited from class org.xwiki.model.reference.EntityReference
appendParent, compareTo, equals, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hashCode, hasParent, removeParent, replaceParent, replaceParent, setName, setParameter, setParameters, setParent, setType, size, toString
-
-
-
-
Field Detail
-
FARM
public static final EntityType FARM
EntityType for the main wiki.
-
mainWikiReference
protected SecurityReference mainWikiReference
Main wiki reference.
-
-
Method Detail
-
getParentSecurityReference
public SecurityReference getParentSecurityReference()
- Returns:
- the parent reference of this security reference. For a reference to a subwiki which do not have a parent by definition, this returns the main wiki reference.
-
getReversedSecurityReferenceChain
public Deque<SecurityReference> getReversedSecurityReferenceChain()
- Returns:
- the reversed reference chain using
getParentSecurityReference()
.
-
getSecurityType
public EntityType getSecurityType()
- Returns:
- the entity reference type, but for the main wiki, return
FARM
.
-
getWikiReference
public SecurityReference getWikiReference()
- Returns:
- a SecurityReference representing the first reference of EntityType.WIKI in this security reference.
-
getOriginalReference
public EntityReference getOriginalReference()
- Returns:
- the original reference used when this security reference was built.
-
getOriginalWikiReference
public WikiReference getOriginalWikiReference()
- Returns:
- the original wiki reference used when this security reference was built. Null if this is not the reference to a wiki.
-
getOriginalSpaceReference
public SpaceReference getOriginalSpaceReference()
- Returns:
- the original space reference used when this security reference was built. Null if this is not the reference to a space.
-
getOriginalDocumentReference
public DocumentReference getOriginalDocumentReference()
- Returns:
- the original document reference used when this security reference was built. Null if this is not the reference to a document.
-
-