atg.servlet.security
Class ServletSecurityUtils

java.lang.Object
  extended by atg.servlet.security.ServletSecurityUtils

public class ServletSecurityUtils
extends java.lang.Object

UserResolver is a collection of static methods to help Security Servlets and droplets to resolve the User instance from the current HttpSession as well as to see if a an element from a list of Personae is represented within User


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
ServletSecurityUtils()
           
 
Method Summary
static User currentUser(java.lang.String pPath, DynamoHttpServletRequest pRequest)
          Given a path and the handle to the current request, this static call will resolve the User instance and return it
static boolean stringArrayToPersonaArray(java.lang.String[] pNames, Persona[] pPersonae, UserAuthority pUserAuthority)
          Takes an array of Personae names which should be contained in a given UserAuthority, and converts them into an array of Personae instances returns true if convertions was successful.
static boolean userHasPersona(User pUser, UserAuthority pUserAuthority, Persona[] pGroups)
          Checks to see if pUser has a Persona in the given array of Personae It is up to the caller to insure the integrity of the arguments provided to this function call.
static boolean userHasPersona(User pUser, UserAuthority pUserAuthority, java.lang.String[] pGroups)
          Checks to see if pUser has a Persona in the given array of Personae It is up to the caller to insure the integrity of the arguments provided to this function call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

ServletSecurityUtils

public ServletSecurityUtils()
Method Detail

currentUser

public static User currentUser(java.lang.String pPath,
                               DynamoHttpServletRequest pRequest)
Given a path and the handle to the current request, this static call will resolve the User instance and return it

Parameters:
pPath - the path to where the User definition lies
pRequest - the current HTTP request (what holds the state)
Returns:
User instance

userHasPersona

public static boolean userHasPersona(User pUser,
                                     UserAuthority pUserAuthority,
                                     Persona[] pGroups)
Checks to see if pUser has a Persona in the given array of Personae It is up to the caller to insure the integrity of the arguments provided to this function call.

Parameters:
pGroups - an array of Personae that represent different user groups
pUser - is an instance of User class which could contain 0 or N Personae
pUserAuthority - UserAuthority instance with which pUser was authenticated
Returns:
true, if the pUser contains at least one of the elements specified in pGroups

userHasPersona

public static boolean userHasPersona(User pUser,
                                     UserAuthority pUserAuthority,
                                     java.lang.String[] pGroups)
Checks to see if pUser has a Persona in the given array of Personae It is up to the caller to insure the integrity of the arguments provided to this function call.

Parameters:
pGroups - an array of names of groups that represent different user personae
pUser - is an instance of User class which could contain 0 or N Personae
pUserAuthority - UserAuthority instance with which pUser was authenticated
Returns:
true, if the pUser contains at least one of the elements specified in pGroups

stringArrayToPersonaArray

public static boolean stringArrayToPersonaArray(java.lang.String[] pNames,
                                                Persona[] pPersonae,
                                                UserAuthority pUserAuthority)
Takes an array of Personae names which should be contained in a given UserAuthority, and converts them into an array of Personae instances returns true if convertions was successful. It is up to the caller to insure the integrity of the arguments passed to this function call.

Parameters:
pNames - an array of String that represent different user groups
pPersonae - is initially empty array of the same size as pNames, which should be filled out by the end of the operation.
pUserAuthority - UserAuthority instance which should contain approprite personae
Returns:
true, if the operation was successful, and false otherwise