org.deltava.security
Interface SecurityContext

All Known Implementing Classes:
CommandContext, GenericServlet.ServletSecurityContext, HTTPContext, ServiceContext

public interface SecurityContext

An interface used by access controllers to query context data to determine access.

Since:
1.0
Version:
1.0
Author:
Luke

Method Summary
 HttpServletRequest getRequest()
          Returns the current servlet request.
 Collection<String> getRoles()
          Returns all the roles for the currently authenticated user.
 Person getUser()
          Returns the currently authenticated user.
 boolean isAuthenticated()
          Queries if the current user is authenticated or anonymous.
 boolean isUserInRole(String roleName)
          Returns if the user is a member of a particular security role.
 

Method Detail

isAuthenticated

boolean isAuthenticated()
Queries if the current user is authenticated or anonymous.

Returns:
TRUE if a user is logged in, otherwise FALSE

getUser

Person getUser()
Returns the currently authenticated user.

Returns:
the user's Person object, or null if anonymous

getRoles

Collection<String> getRoles()
Returns all the roles for the currently authenticated user.

Returns:
a Collection of role names, or an empty collection

isUserInRole

boolean isUserInRole(String roleName)
Returns if the user is a member of a particular security role.

Parameters:
roleName - the role name
Returns:
TRUE if the user is a member of the role, otherwise FALSE

getRequest

HttpServletRequest getRequest()
Returns the current servlet request. Some access controllers may need to examine attributes within the servlet request.

Returns:
the HTTP servlet request


Copyright © 2004-2009 Global Virtual Airlines Group. All Rights Reserved.