org.blojsom.authorization
Interface AuthorizationProvider

All Known Implementing Classes:
PropertiesAuthorizationProvider

public interface AuthorizationProvider

AuthorizationProvider

Since:
blojsom 2.16
Version:
$Id: AuthorizationProvider.java,v 1.4 2006/01/04 16:59:53 czarneckid Exp $
Author:
David Czarnecki

Method Summary
 void authorize(BlogUser blogUser, java.util.Map authorizationContext, java.lang.String username, java.lang.String password)
          Authorize a username and password for the given BlogUser
 void checkPermission(BlogUser blogUser, java.util.Map permissionContext, java.lang.String username, java.lang.String permission)
          Check a permission for the given BlogUser
 void init(javax.servlet.ServletConfig servletConfig, BlojsomConfiguration blojsomConfiguration)
          Initialization method for the authorization provider
 void loadAuthenticationCredentials(BlogUser blogUser)
          Loads the authentication credentials for a given user
 

Method Detail

init

public void init(javax.servlet.ServletConfig servletConfig,
                 BlojsomConfiguration blojsomConfiguration)
          throws BlojsomConfigurationException
Initialization method for the authorization provider

Parameters:
servletConfig - ServletConfig for obtaining any initialization parameters
blojsomConfiguration - BlojsomConfiguration for blojsom-specific configuration information
Throws:
BlojsomConfigurationException - If there is an error initializing the provider

loadAuthenticationCredentials

public void loadAuthenticationCredentials(BlogUser blogUser)
                                   throws BlojsomException
Loads the authentication credentials for a given user

Parameters:
blogUser - BlogUser
Throws:
BlojsomException - If there is an error loading the user's authentication credentials

authorize

public void authorize(BlogUser blogUser,
                      java.util.Map authorizationContext,
                      java.lang.String username,
                      java.lang.String password)
               throws BlojsomException
Authorize a username and password for the given BlogUser

Parameters:
blogUser - BlogUser
authorizationContext - Map to be used to provide other information for authorization. This will change depending on the authorization provider.
username - Username
password - Password
Throws:
BlojsomException - If there is an error authorizing the username and password

checkPermission

public void checkPermission(BlogUser blogUser,
                            java.util.Map permissionContext,
                            java.lang.String username,
                            java.lang.String permission)
                     throws BlojsomException
Check a permission for the given BlogUser

Parameters:
blogUser - BlogUser
permissionContext - Map to be used to provide other information for permission check. This will change depending on the authorization provider.
username - Username
permission - Permission
Throws:
BlojsomException - If there is an error checking the permission for the username and permission