com.atlassian.seraph.auth
Class GroupRoleMapper

java.lang.Object
  extended by com.atlassian.seraph.auth.GroupRoleMapper
All Implemented Interfaces:
RoleMapper, Initable

public class GroupRoleMapper
extends java.lang.Object
implements RoleMapper

A simple RoleMapper which maps directly between group names and role names. If a user is a member of someGroup, the are in the 'someGroup' role. Users can log in if they exist.


Constructor Summary
GroupRoleMapper()
           
 
Method Summary
 boolean canLogin(java.security.Principal user, javax.servlet.http.HttpServletRequest request)
          Users can login if they exist.
 boolean hasRole(java.security.Principal user, javax.servlet.http.HttpServletRequest request, java.lang.String role)
          Assume that roles == groups.
 void init(java.util.Map params, SecurityConfig config)
          Initialise the configuration object with the given "init-params".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupRoleMapper

public GroupRoleMapper()
Method Detail

init

public void init(java.util.Map params,
                 SecurityConfig config)
Description copied from interface: Initable
Initialise the configuration object with the given "init-params".

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.

hasRole

public boolean hasRole(java.security.Principal user,
                       javax.servlet.http.HttpServletRequest request,
                       java.lang.String role)
Assume that roles == groups.

Specified by:
hasRole in interface RoleMapper

canLogin

public boolean canLogin(java.security.Principal user,
                        javax.servlet.http.HttpServletRequest request)
Users can login if they exist.

Specified by:
canLogin in interface RoleMapper


Copyright © 2009 Atlassian Software Systems Pty Ltd. All Rights Reserved.