net.sf.jzeno.aop
Class SecuritySupport

java.lang.Object
  extended by net.sf.jzeno.aop.SecuritySupport

public class SecuritySupport
extends java.lang.Object

This class allows you to perfom security related operations from any part of your application.


Constructor Summary
SecuritySupport()
           
 
Method Summary
static boolean currentUserHasPermission(java.lang.String permissionName)
           Checks that the current user has the required user privilege.
static boolean currentUserHasRole(java.lang.String roleName)
           Checks that the current user has the required user privilege.
static User getCurrentUser()
           Retrieves the current user.
static java.lang.String getCurrentUserName()
           Retrieve the name of the user that is associated with this session.
static void login(User user)
           Sets the current logged in user.
static void loginDummy()
           
static void logout(java.lang.String userName)
           This operation should be called when the user logs out.
static void logoutAll()
           This operation flushes all the user data caches and removes any current user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecuritySupport

public SecuritySupport()
Method Detail

getCurrentUserName

public static java.lang.String getCurrentUserName()

Retrieve the name of the user that is associated with this session.


login

public static void login(User user)

Sets the current logged in user. Only called by the security framework after a login is detected.


loginDummy

public static void loginDummy()

getCurrentUser

public static User getCurrentUser()

Retrieves the current user.

Returns:
a Userinstance, representing the currently logged in user.

logout

public static void logout(java.lang.String userName)

This operation should be called when the user logs out.

Parameters:
userName - the user that logged out.

logoutAll

public static void logoutAll()

This operation flushes all the user data caches and removes any current user. Handy for use in test cases, etc..


currentUserHasPermission

public static boolean currentUserHasPermission(java.lang.String permissionName)

Checks that the current user has the required user privilege.


currentUserHasRole

public static boolean currentUserHasRole(java.lang.String roleName)

Checks that the current user has the required user privilege.