atg.adapter.secure
Class GenericSecuredRepositoryItem

java.lang.Object
  extended by atg.security.GenericSecuredObject
      extended by atg.adapter.secure.SecuredRepositoryObject
          extended by atg.adapter.secure.GenericSecuredRepositoryItem
All Implemented Interfaces:
DisplayableItem, RepositoryItem, SecuredRepositoryItem, SecuredObject
Direct Known Subclasses:
GenericSecuredMutableRepositoryItem

public class GenericSecuredRepositoryItem
extends SecuredRepositoryObject
implements SecuredRepositoryItem

A class which wraps a repository item to add security features.


Field Summary
static java.lang.String CLASS_VERSION
           
static AccessRight[] ITEM_RIGHTS
          Set of access rights that apply to a generic secured repository item.
static java.util.Map ITEM_RIGHTS_MAP
          Map of access rights for generic secured repository items.
protected  SecurityPolicy mPolicy
          The security policy that is applicable for this secured item.
protected  atg.core.util.UnsyncCaseInsensitiveHashtable mPropertyObjects
          A mapping of the property name to SecuredRepositoryObjects, which control access to property security.
 
Fields inherited from class atg.adapter.secure.SecuredRepositoryObject
mDescriptor, mItem, mMutableItem, mRepository
 
Fields inherited from class atg.security.GenericSecuredObject
mAcl, mOwner, mSecurityContext
 
Constructor Summary
GenericSecuredRepositoryItem(GenericSecuredRepository pRepository, RepositoryItem pItem)
          Wraps a repository item with a secured repository item.
 
Method Summary
 void checkPropertyAccess(java.lang.String pPropertyName, AccessRight pRight)
          Checks to see if the current user has the indicated access right for the specified property and, if not, throws a runtime security exception.
 boolean equals(java.lang.Object o)
          Two secured repository items are considered equal if they share the same item descriptor and ID.
 RepositoryItemDescriptor getItemDescriptor()
          Returns the RepositoryItemDescriptor property, which describes the known properties for the item
 java.lang.String getItemDisplayName()
          The name of this item which can be used in a UI.
 RepositoryItemDescriptor getOriginalItemDescriptor()
          Returns the item descriptor that we're wrapping.
 AccessControlList getPropertyAccessControlList(java.lang.String pPropertyName)
          Returns the item-specific access control list for the indicated property.
 SecuredObject getPropertySecuredObject(java.lang.String pPropertyName)
          Returns the secured object that controls this property.
 java.lang.Object getPropertyValue(java.lang.String pPropertyName)
          Returns the property of the given name
 Repository getRepository()
          Returns the Repository which contains this item
 java.lang.String getRepositoryId()
          Returns the unique id associated with this object in the repository.
 boolean hasAccess(AccessRight pRight)
          Checks to see if the current user has the indicated access right.
 int hashCode()
          Returns the hash code for our repository id.
 boolean hasPropertyAccess(java.lang.String pPropertyName, AccessRight pRight)
          Checks to see if the current user has the indicated access right for the specified property.
 boolean isRemoved()
          Returns true if the wrapped item has been removed
 boolean isTransient()
          Returns true if this item has been created with createItem, but not yet added to the repository with addItem.
 
Methods inherited from class atg.adapter.secure.SecuredRepositoryObject
getRepositoryItem, getSecuredObjectDescriptor, invalidate, logError, logError, logError, supportsAccessControlList, supportsOwner, unsecuredGetAccessControlList, unsecuredGetContainers, unsecuredGetOwner, unsecuredSetAccessControlList, unsecuredSetOwner
 
Methods inherited from class atg.security.GenericSecuredObject
checkAccess, checkRuntimeAccess, getAccessControlList, getOwner, getSecurityContext, setAccessControlList, setOwner, setSecurityContext, unsecuredGetSecuredContainers, unsecuredSetCreationSecurity
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface atg.security.SecuredObject
getAccessControlList, getOwner, getSecurityContext, setAccessControlList, setOwner, supportsAccessControlList, supportsOwner, unsecuredGetAccessControlList, unsecuredGetContainers, unsecuredGetOwner, unsecuredSetAccessControlList, unsecuredSetOwner
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

ITEM_RIGHTS

public static final AccessRight[] ITEM_RIGHTS
Set of access rights that apply to a generic secured repository item.


ITEM_RIGHTS_MAP

public static final java.util.Map ITEM_RIGHTS_MAP
Map of access rights for generic secured repository items.


mPolicy

protected SecurityPolicy mPolicy
The security policy that is applicable for this secured item. We break this out of the security context for performance.


mPropertyObjects

protected atg.core.util.UnsyncCaseInsensitiveHashtable mPropertyObjects
A mapping of the property name to SecuredRepositoryObjects, which control access to property security. If this is null, there are no properties configured with security.

Constructor Detail

GenericSecuredRepositoryItem

public GenericSecuredRepositoryItem(GenericSecuredRepository pRepository,
                                    RepositoryItem pItem)
                             throws RepositoryException
Wraps a repository item with a secured repository item.

Throws:
RepositoryException
Method Detail

checkPropertyAccess

public void checkPropertyAccess(java.lang.String pPropertyName,
                                AccessRight pRight)
Checks to see if the current user has the indicated access right for the specified property and, if not, throws a runtime security exception.


getOriginalItemDescriptor

public RepositoryItemDescriptor getOriginalItemDescriptor()
                                                   throws RepositoryException
Returns the item descriptor that we're wrapping.

Throws:
RepositoryException

isRemoved

public boolean isRemoved()
Returns true if the wrapped item has been removed


hashCode

public int hashCode()
Returns the hash code for our repository id.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Two secured repository items are considered equal if they share the same item descriptor and ID.

Overrides:
equals in class java.lang.Object

getItemDisplayName

public java.lang.String getItemDisplayName()
The name of this item which can be used in a UI.

Specified by:
getItemDisplayName in interface DisplayableItem

getRepositoryId

public java.lang.String getRepositoryId()
Returns the unique id associated with this object in the repository. The String representation should be a platform independent notation that can be used outside the Java language. (e.g. used with HTTP Cookies).

Specified by:
getRepositoryId in interface RepositoryItem

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String pPropertyName)
Returns the property of the given name

Specified by:
getPropertyValue in interface RepositoryItem

getRepository

public Repository getRepository()
Returns the Repository which contains this item

Specified by:
getRepository in interface RepositoryItem

getItemDescriptor

public RepositoryItemDescriptor getItemDescriptor()
                                           throws RepositoryException
Returns the RepositoryItemDescriptor property, which describes the known properties for the item

Specified by:
getItemDescriptor in interface RepositoryItem
Throws:
RepositoryException

isTransient

public boolean isTransient()
Returns true if this item has been created with createItem, but not yet added to the repository with addItem. Returns false for all other items.

Specified by:
isTransient in interface RepositoryItem

getPropertyAccessControlList

public AccessControlList getPropertyAccessControlList(java.lang.String pPropertyName)
                                               throws SecurityException
Returns the item-specific access control list for the indicated property. This will return null if access control is not supported on the property.

Specified by:
getPropertyAccessControlList in interface SecuredRepositoryItem
Throws:
SecurityException
See Also:
SecuredRepositoryItemDescriptor.getPropertyAccessControlList

getPropertySecuredObject

public SecuredObject getPropertySecuredObject(java.lang.String pPropertyName)
                                       throws SecurityException
Returns the secured object that controls this property. This is useful if you need to do your own access checks against the property.

Specified by:
getPropertySecuredObject in interface SecuredRepositoryItem
Throws:
SecurityException

hasAccess

public boolean hasAccess(AccessRight pRight)
                  throws SecurityException
Checks to see if the current user has the indicated access right.

Specified by:
hasAccess in interface SecuredRepositoryItem
Overrides:
hasAccess in class GenericSecuredObject
Throws:
SecurityException
See Also:
ImplementationSecurityException

hasPropertyAccess

public boolean hasPropertyAccess(java.lang.String pPropertyName,
                                 AccessRight pRight)
                          throws SecurityException
Checks to see if the current user has the indicated access right for the specified property.

Specified by:
hasPropertyAccess in interface SecuredRepositoryItem
Throws:
SecurityException
See Also:
ImplementationSecurityException