01: /*
02: * $Id: UnauthorizedActionException.java,v 1.1 2005/12/22 22:27:01 jonathanlocke
03: * Exp $ $Revision: 459562 $ $Date: 2006-03-01 16:25:19 +0100 (Wed, 01 Mar 2006) $
04: *
05: * ==============================================================================
06: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
07: * use this file except in compliance with the License. You may obtain a copy of
08: * the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15: * License for the specific language governing permissions and limitations under
16: * the License.
17: */
18: package wicket.authorization;
19:
20: import wicket.Component;
21:
22: /**
23: * Exception that is thrown when an action is not authorized.
24: *
25: * @author Jonathan Locke
26: * @author Eelco Hillenius
27: */
28: public class UnauthorizedActionException extends AuthorizationException {
29: private static final long serialVersionUID = 1L;
30:
31: /** The action */
32: private Action action;
33:
34: /** The component that caused the unauthorized exception */
35: private final Component component;
36:
37: /**
38: * Construct.
39: *
40: * @param component
41: * The component that caused the unauthorized exception
42: * @param action
43: * The action
44: */
45: public UnauthorizedActionException(Component component,
46: Action action) {
47: super ("Component " + component + " does not permit action "
48: + action);
49: this .component = component;
50: this .action = action;
51: }
52:
53: /**
54: * @return The action that was forbidden
55: */
56: public Action getAction() {
57: return action;
58: }
59:
60: /**
61: * @return The component that caused the unauthorized exception
62: */
63: public Component getComponent() {
64: return component;
65: }
66: }
|