org.xwiki.security
Class SecurityReference

java.lang.Object
  extended by org.xwiki.model.reference.EntityReference
      extended by 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: c99c9d41c71bcc70890051c045ec986f0edd30fb $
See Also:
SecurityReferenceFactory}, Serialized Form

Field Summary
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
 DocumentReference getOriginalDocumentReference()
           
 EntityReference getOriginalReference()
           
 SpaceReference getOriginalSpaceReference()
           
 WikiReference getOriginalWikiReference()
           
 SecurityReference getParentSecurityReference()
           
 Deque<SecurityReference> getReversedSecurityReferenceChain()
           
 EntityType getSecurityType()
           
 SecurityReference getWikiReference()
           
 
Methods inherited from class org.xwiki.model.reference.EntityReference
appendParent, compareTo, equals, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, hashCode, removeParent, replaceParent, setName, setParameter, setParameters, setParent, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 SecurityReference.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.


Copyright © 2004–2014 XWiki. All rights reserved.