01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/user/tags/sakai_2-4-1/user-api/api/src/java/org/sakaiproject/user/api/UserPermissionException.java $
03: * $Id: UserPermissionException.java 7054 2006-03-27 14:38:57Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.user.api;
21:
22: /**
23: * <p>
24: * UserPermissionException is thrown when an attempt is made to perform a user operation that the end-user does not have permission for.
25: * </p>
26: */
27: public class UserPermissionException extends Exception {
28: /** The id of the user. */
29: private String m_user = null;
30:
31: /**
32: * Access the id of the user.
33: *
34: * @return The id of the user.
35: */
36: public String getUser() {
37: return m_user;
38: }
39:
40: /** The function name. */
41: private String m_function = null;
42:
43: /**
44: * Access the function name.
45: *
46: * @return The function name.
47: */
48: public String getFunction() {
49: return m_function;
50: }
51:
52: /** The resource id. */
53: private String m_resource = null;
54:
55: /**
56: * Access the resource id.
57: *
58: * @return The resource id.
59: */
60: public String getResource() {
61: return m_resource;
62: }
63:
64: /**
65: * Construct.
66: *
67: * @param user
68: * The id of the user.
69: * @param lock
70: * The lock name.
71: * @param resource
72: * The resource id.
73: */
74: public UserPermissionException(String user, String lock,
75: String resource) {
76: m_user = user;
77: m_function = lock;
78: m_resource = resource;
79: }
80:
81: public String toString() {
82: return super .toString() + " user=" + m_user + " function="
83: + m_function + " resource=" + m_resource;
84: }
85: }
|