public class AccessRightAccessController extends GenericService implements AccessController
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
AccessRightAccessController() |
Modifier and Type | Method and Description |
---|---|
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
|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
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 requestprotected 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 nameprotected java.lang.String getAccessRightFromItem(RepositoryItem pAccessRightItem)
accessRightNamePropertyName
property of this
controller that contains the access right namepAccessRightItem
- the item that contains the access right nameprotected 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