com.aoindustries.website
Class PermissionAction

java.lang.Object
  extended by Action
      extended by com.aoindustries.website.SiteSettingsAction
          extended by com.aoindustries.website.LocaleAction
              extended by com.aoindustries.website.SkinAction
                  extended by com.aoindustries.website.ProtocolAction
                      extended by com.aoindustries.website.HttpsAction
                          extended by com.aoindustries.website.AuthenticatedAction
                              extended by com.aoindustries.website.PermissionAction
Direct Known Subclasses:
AddCreditCardAction, CancelAction, CancelFeedbackAction, CancelFeedbackCompletedAction, ConfigureAutomaticBillingAction, ConfigureAutomaticBillingCompletedAction, CreateAction, CreateCompletedAction, CreditCardManagerAction, DeleteCreditCardAction, DeleteCreditCardCompletedAction, EditAction, EditCompletedAction, EditCreditCardAction, GlobalPasswordSetterAction, GlobalPasswordSetterCompletedAction, LinuxAccountPasswordSetterAction, LinuxAccountPasswordSetterCompletedAction, MakePaymentSelectCardAction, MakePaymentStoredCardAction, MySQLPasswordSetterAction, MySQLPasswordSetterCompletedAction, MySQLReplicationMonitorAction, PostgreSQLPasswordSetterAction, PostgreSQLPasswordSetterCompletedAction, VncConsoleAction, VncViewerAction

public abstract class PermissionAction
extends AuthenticatedAction

Makes sure the authenticated user has the necessary permissions to perform the requested task. If they do not, sets the request attribute "permissionDenied" with the List<AOServConnector> and returns mapping for "permissionDenied". Otherwise, if all the permissions have been granted, calls executePermissionGranted. The default implementation of this new executePermissionGranted method simply returns the mapping of "success".

Author:
AO Industries, Inc.

Field Summary
 
Fields inherited from class com.aoindustries.website.ProtocolAction
HTTP, HTTPS
 
Constructor Summary
PermissionAction()
           
 
Method Summary
 ActionForward execute(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SiteSettings siteSettings, java.util.Locale locale, Skin skin, com.aoindustries.aoserv.client.AOServConnector aoConn)
          Once authentication has been handled, this version of the execute method is invoked.
 ActionForward executePermissionDenied(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SiteSettings siteSettings, java.util.Locale locale, Skin skin, com.aoindustries.aoserv.client.AOServConnector aoConn, java.util.List<com.aoindustries.aoserv.client.AOServPermission> permissions)
          Called when the permissions has been denied.
 ActionForward executePermissionGranted(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, SiteSettings siteSettings, java.util.Locale locale, Skin skin, com.aoindustries.aoserv.client.AOServConnector aoConn)
          Called when permission has been granted.
abstract  java.util.List<com.aoindustries.aoserv.client.AOServPermission.Permission> getPermissions()
          Gets the list of permissions that are required for this action.
 
Methods inherited from class com.aoindustries.website.AuthenticatedAction
executeProtocolAccepted, getAoConn, getAuthenticatedAoConn
 
Methods inherited from class com.aoindustries.website.HttpsAction
getAcceptableProtocols
 
Methods inherited from class com.aoindustries.website.ProtocolAction
execute
 
Methods inherited from class com.aoindustries.website.SkinAction
execute, getDefaultSkin, getSkin
 
Methods inherited from class com.aoindustries.website.LocaleAction
execute, getDefaultLocale, getEffectiveLocale
 
Methods inherited from class com.aoindustries.website.SiteSettingsAction
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionAction

public PermissionAction()
Method Detail

execute

public final ActionForward execute(ActionMapping mapping,
                                   ActionForm form,
                                   javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   SiteSettings siteSettings,
                                   java.util.Locale locale,
                                   Skin skin,
                                   com.aoindustries.aoserv.client.AOServConnector aoConn)
                            throws java.lang.Exception
Description copied from class: AuthenticatedAction
Once authentication has been handled, this version of the execute method is invoked. The default implementation of this method simply returns the mapping of "success".

Overrides:
execute in class AuthenticatedAction
Throws:
java.lang.Exception

executePermissionGranted

public ActionForward executePermissionGranted(ActionMapping mapping,
                                              ActionForm form,
                                              javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response,
                                              SiteSettings siteSettings,
                                              java.util.Locale locale,
                                              Skin skin,
                                              com.aoindustries.aoserv.client.AOServConnector aoConn)
                                       throws java.lang.Exception
Called when permission has been granted. By default, returns mapping for "success".

Throws:
java.lang.Exception

executePermissionDenied

public ActionForward executePermissionDenied(ActionMapping mapping,
                                             ActionForm form,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response,
                                             SiteSettings siteSettings,
                                             java.util.Locale locale,
                                             Skin skin,
                                             com.aoindustries.aoserv.client.AOServConnector aoConn,
                                             java.util.List<com.aoindustries.aoserv.client.AOServPermission> permissions)
                                      throws java.lang.Exception
Called when the permissions has been denied. By default, sets request attribute Constants.PERMISSION_DENIED and returns mapping for "permission-denied".

Throws:
java.lang.Exception

getPermissions

public abstract java.util.List<com.aoindustries.aoserv.client.AOServPermission.Permission> getPermissions()
Gets the list of permissions that are required for this action. Returning a null or empty list will result in nothing being allowed.

See Also:
AOServPermission