de.lmu.ifi.pst.x10080133.monitor
Class SecurityProvider

java.lang.Object
  extended by de.lmu.ifi.pst.x10080133.monitor.SecurityProvider
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Controller
public class SecurityProvider
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware

Class parses SECURITY_FILENAME file and votes for access control and gives the corresponding violation location or login node if needed

Author:
Roman.Schwienbacher

Field Summary
private  org.apache.commons.logging.Log log
           
static java.lang.String NAVIGATION_PROPERTY
           
private static NavigationFile navigationFile
           
static java.lang.String SECURITY_FILENAME
           
 
Constructor Summary
SecurityProvider()
           
 
Method Summary
static java.lang.String getHomeLocation()
           
static java.lang.String getViolationLocation(java.lang.String requestedLocation)
          Gets violationLocation in case that access is not allowed corresponding to given params and navigationFile
static boolean isAllowedToAccess(java.lang.String[] userRoles, java.lang.String preVisitedLocation, java.lang.String requestedLocation)
          Decides if user is allowed to access requestedLocation with his userRoles and preVisitedLocation by navigationFile
 void setApplicationContext(org.springframework.context.ApplicationContext arg0)
          Read and parse security.properties to NavigationFile instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private final org.apache.commons.logging.Log log

SECURITY_FILENAME

public static final java.lang.String SECURITY_FILENAME
See Also:
Constant Field Values

NAVIGATION_PROPERTY

public static final java.lang.String NAVIGATION_PROPERTY
See Also:
Constant Field Values

navigationFile

private static NavigationFile navigationFile
Constructor Detail

SecurityProvider

public SecurityProvider()
Method Detail

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext arg0)
                           throws org.springframework.beans.BeansException
Read and parse security.properties to NavigationFile instance

Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getHomeLocation

public static java.lang.String getHomeLocation()
Returns:
login location by home attribute

isAllowedToAccess

public static boolean isAllowedToAccess(java.lang.String[] userRoles,
                                        java.lang.String preVisitedLocation,
                                        java.lang.String requestedLocation)
Decides if user is allowed to access requestedLocation with his userRoles and preVisitedLocation by navigationFile

Parameters:
userRoles -
preVisitedLocation -
requestedLocation -
Returns:

getViolationLocation

public static java.lang.String getViolationLocation(java.lang.String requestedLocation)
Gets violationLocation in case that access is not allowed corresponding to given params and navigationFile

Parameters:
requestedLocation -
Returns: