01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.user;
18:
19: import java.io.Serializable;
20:
21: /**
22: * Identifies the capabilities of a particular {@link UserService} implementation.
23: *
24: * @see UserService
25: *
26: * @author ewestfal
27: */
28: public class UserCapabilities implements Serializable {
29:
30: private static final long serialVersionUID = 2306224360420470187L;
31:
32: private boolean lookupSupported = false;
33: private boolean reportSupported = false;
34: private boolean createSupported = false;
35: private boolean editSupported = false;
36:
37: public boolean isCreateSupported() {
38: return createSupported;
39: }
40:
41: public void setCreateSupported(boolean createSupported) {
42: this .createSupported = createSupported;
43: }
44:
45: public boolean isEditSupported() {
46: return editSupported;
47: }
48:
49: public void setEditSupported(boolean editSupported) {
50: this .editSupported = editSupported;
51: }
52:
53: public boolean isLookupSupported() {
54: return lookupSupported;
55: }
56:
57: public void setLookupSupported(boolean lookupSupported) {
58: this .lookupSupported = lookupSupported;
59: }
60:
61: public boolean isReportSupported() {
62: return reportSupported;
63: }
64:
65: public void setReportSupported(boolean reportSupported) {
66: this .reportSupported = reportSupported;
67: }
68:
69: public static UserCapabilities getAll() {
70: UserCapabilities capabilities = new UserCapabilities();
71: capabilities.setCreateSupported(true);
72: capabilities.setEditSupported(true);
73: capabilities.setLookupSupported(true);
74: capabilities.setReportSupported(true);
75: return capabilities;
76: }
77:
78: public static UserCapabilities getReadOnly() {
79: UserCapabilities capabilities = new UserCapabilities();
80: capabilities.setReportSupported(true);
81: capabilities.setLookupSupported(true);
82: return capabilities;
83: }
84:
85: }
|