|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.userprofiling.AccessRightAccessController
public class AccessRightAccessController
This class grants or denies access based on whether the given profile has one of the configured access rights. This controller assumes a specific data model for access rights, which involves the Profile having a Collection property that contains RepositoryItems that have a String property identifying the name of an access right.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
AccessRightAccessController()
|
Method Summary | |
---|---|
boolean |
allowAccess(Profile pProfile,
DynamoHttpServletRequest pRequest)
Checks the accessRights collection of the user for an access right whose name matches any of the strings in the allowedAccessRights collection. |
protected boolean |
collectionContainsAllowedAccessRight(java.util.Collection pAccessRights)
Checks to see if the given collection contains an allowed access right as configured on this instance |
protected java.lang.String |
getAccessRightFromItem(java.lang.Object pAccessRightItem)
Gets the access right name from the given object. |
protected java.lang.String |
getAccessRightFromItem(RepositoryItem pAccessRightItem)
Gets the access right name from the given RepositoryItem. |
java.lang.String |
getAccessRightNamePropertyName()
|
protected java.util.Collection |
getAccessRightsProperty(Profile pProfile)
Gets the accessRights property from the given profile using the name specified in the accessRightPropertyName property. |
java.lang.String |
getAccessRightsPropertyName()
|
java.util.List |
getAllowedAccessRightNames()
|
java.lang.String |
getDeniedAccessURL()
Returns a URL the user should be redirected to if allowAccess returns false. |
java.lang.String |
getDeniedAccessURL(Profile pProfile)
Returns a URL the user should be redirected to if allowAccess returns false. |
void |
setAccessRightNamePropertyName(java.lang.String pAccessRightNamePropertyName)
The name of the name property of the accessRight item |
void |
setAccessRightsPropertyName(java.lang.String pAccessRightsPropertyName)
The name of the accessRights property of the internalUser |
void |
setAllowedAccessRightNames(java.util.List pAllowedAccessRightNames)
The names of the access rights that will allow access |
void |
setDeniedAccessURL(java.lang.String pDeniedAccessURL)
A URL the user should be redirected to if allowAccess returns false |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public AccessRightAccessController()
Method Detail |
---|
public void setAccessRightsPropertyName(java.lang.String pAccessRightsPropertyName)
pAccessRightPropertyName
- the name of the accessRights property of the internalUserpublic java.lang.String getAccessRightsPropertyName()
public void setAccessRightNamePropertyName(java.lang.String pAccessRightNamePropertyName)
pAccessRightNamePropertyName
- the name of the name property of the accessRight itempublic java.lang.String getAccessRightNamePropertyName()
public void setAllowedAccessRightNames(java.util.List pAllowedAccessRightNames)
pAccessRights
- the names of the access rights that will allow accesspublic java.util.List getAllowedAccessRightNames()
public void setDeniedAccessURL(java.lang.String pDeniedAccessURL)
pDeniedAccessURL
- the URL the user should be redirected to if allowAccess returns falsepublic java.lang.String getDeniedAccessURL()
public java.lang.String getDeniedAccessURL(Profile pProfile)
getDeniedAccessURL
in interface AccessController
public boolean allowAccess(Profile pProfile, DynamoHttpServletRequest pRequest)
allowedAccessRights
collection.
If there are no matches, or access cannot be determined
due to missing information, incorrect configuration, or a data
model that doesn't match what is expected, then access is denied.
allowAccess
in interface AccessController
pProfile
- the profile that is requesting accesspRequest
- the current http request
protected boolean collectionContainsAllowedAccessRight(java.util.Collection pAccessRights)
pAccessRights
- the collection of access right names to checkprotected java.lang.String getAccessRightFromItem(java.lang.Object pAccessRightItem)
pAccessRightItem
- the object that contains the access right name
protected java.lang.String getAccessRightFromItem(RepositoryItem pAccessRightItem)
accessRightNamePropertyName
property of this
controller that contains the access right name
pAccessRightItem
- the item that contains the access right name
protected java.util.Collection getAccessRightsProperty(Profile pProfile)
accessRightPropertyName
property.
This property is expected to be an instance of a
java.util.Collection
pProfile
- the profile to get the access rights property from
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |