com.atlassian.seraph.service
Class PathService

java.lang.Object
  extended by com.atlassian.seraph.service.PathService
All Implemented Interfaces:
Initable, SecurityService, Serializable

public class PathService
extends Object
implements SecurityService

Configures Seraph to require certain roles to access certain URL paths.

Single init-param 'config.file' which is the location of the XML config file. Default value is '/seraph-paths.xml' (loaded from classpath - usually in /WEB-INF/classes)

Here's a sample of the XML config file. Path names must be unique

 <seraph-paths>
     <path name="admin">
         <url-pattern>/secure/admin/*</url-pattern>
         <role-name>administrators</role-name>
     </path>
     <path name="secured">
         <url-pattern>/secure/*</url-pattern>
         <role-name>users</role-name>
     </path>
 </seraph-paths>
 

See Also:
Serialized Form

Constructor Summary
PathService()
           
 
Method Summary
 void destroy()
           
 Set<String> getRequiredRoles(javax.servlet.http.HttpServletRequest request)
           
 Set<String> getRequiredRoles(String servletPath)
           
 void init(Map<String,String> params, SecurityConfig config)
          Init the service - configure it from the config file
protected  String[] parseRoles(String roleNames)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathService

public PathService()
Method Detail

init

public void init(Map<String,String> params,
                 SecurityConfig config)
Init the service - configure it from the config file

Specified by:
init in interface Initable
Parameters:
params - The map of "init-params" extracted from the Seraph config file. This is guaranteed not null.
config - The Seraph SecurityConfig class that is initialising the config objects. This object will only be partially initialised at this time.

parseRoles

protected String[] parseRoles(String roleNames)

destroy

public void destroy()
Specified by:
destroy in interface SecurityService

getRequiredRoles

public Set<String> getRequiredRoles(javax.servlet.http.HttpServletRequest request)
Specified by:
getRequiredRoles in interface SecurityService

getRequiredRoles

public Set<String> getRequiredRoles(String servletPath)


Copyright © 2013 Atlassian. All Rights Reserved.