com.atlassian.seraph.service
Class PathService
java.lang.Object
com.atlassian.seraph.service.PathService
- All Implemented Interfaces:
- Initable, SecurityService, java.io.Serializable
public class PathService
- extends java.lang.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
|
Method Summary |
void |
destroy()
|
java.util.Set<java.lang.String> |
getRequiredRoles(javax.servlet.http.HttpServletRequest request)
|
java.util.Set<java.lang.String> |
getRequiredRoles(java.lang.String servletPath)
|
void |
init(java.util.Map<java.lang.String,java.lang.String> params,
SecurityConfig config)
Init the service - configure it from the config file |
protected java.lang.String[] |
parseRoles(java.lang.String roleNames)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PathService
public PathService()
init
public void init(java.util.Map<java.lang.String,java.lang.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 java.lang.String[] parseRoles(java.lang.String roleNames)
destroy
public void destroy()
- Specified by:
destroy in interface SecurityService
getRequiredRoles
public java.util.Set<java.lang.String> getRequiredRoles(javax.servlet.http.HttpServletRequest request)
- Specified by:
getRequiredRoles in interface SecurityService
getRequiredRoles
public java.util.Set<java.lang.String> getRequiredRoles(java.lang.String servletPath)
Copyright © 2012 Atlassian. All Rights Reserved.