View Javadoc
1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.uif.util;
17  
18  import java.util.Set;
19  
20  import org.kuali.rice.kim.api.identity.Person;
21  import org.kuali.rice.krad.uif.container.CollectionGroup;
22  import org.kuali.rice.krad.uif.container.Group;
23  import org.kuali.rice.krad.uif.element.Action;
24  import org.kuali.rice.krad.uif.field.DataField;
25  import org.kuali.rice.krad.uif.field.Field;
26  import org.kuali.rice.krad.uif.view.View;
27  import org.kuali.rice.krad.uif.view.ViewAuthorizer;
28  import org.kuali.rice.krad.uif.view.ViewModel;
29  import org.kuali.rice.krad.uif.widget.Widget;
30  
31  class MockViewAuthorizer implements ViewAuthorizer {
32  
33      @Override
34      public Set<String> getActionFlags(View view, ViewModel model, Person user, Set<String> actions) {
35          return new java.util.HashSet<String>();
36      }
37  
38      @Override
39      public Set<String> getEditModes(View view, ViewModel model, Person user, Set<String> editModes) {
40          return new java.util.HashSet<String>();
41      }
42  
43      @Override
44      public boolean canOpenView(View view, ViewModel model, Person user) {
45          return true;
46      }
47  
48      @Override
49      public boolean canEditView(View view, ViewModel model, Person user) {
50          return true;
51      }
52  
53      @Override
54      public boolean canUnmaskField(View view, ViewModel model, DataField field, String propertyName, Person user) {
55          return true;
56      }
57  
58      @Override
59      public boolean canPartialUnmaskField(View view, ViewModel model, DataField field, String propertyName,
60              Person user) {
61          return true;
62      }
63  
64      @Override
65      public boolean canEditField(View view, ViewModel model, Field field, String propertyName, Person user) {
66          return true;
67      }
68  
69      @Override
70      public boolean canViewField(View view, ViewModel model, Field field, String propertyName, Person user) {
71          return true;
72      }
73  
74      @Override
75      public boolean canEditGroup(View view, ViewModel model, Group group, String groupId, Person user) {
76          return true;
77      }
78  
79      @Override
80      public boolean canViewGroup(View view, ViewModel model, Group group, String groupId, Person user) {
81          return true;
82      }
83  
84      @Override
85      public boolean canEditWidget(View view, ViewModel model, Widget widget, String widgetId, Person user) {
86          return true;
87      }
88  
89      @Override
90      public boolean canViewWidget(View view, ViewModel model, Widget widget, String widgetId, Person user) {
91          return true;
92      }
93  
94      @Override
95      public boolean canPerformAction(View view, ViewModel model, Action action, String actionEvent, String actionId,
96              Person user) {
97          return true;
98      }
99  
100     @Override
101     public boolean canEditLine(View view, ViewModel model, CollectionGroup collectionGroup,
102             String collectionPropertyName, Object line, Person user) {
103         return true;
104     }
105 
106     @Override
107     public boolean canViewLine(View view, ViewModel model, CollectionGroup collectionGroup,
108             String collectionPropertyName, Object line, Person user) {
109         return true;
110     }
111 
112     @Override
113     public boolean canEditLineField(View view, ViewModel model, CollectionGroup collectionGroup,
114             String collectionPropertyName, Object line, Field field, String propertyName, Person user) {
115         return true;
116     }
117 
118     @Override
119     public boolean canViewLineField(View view, ViewModel model, CollectionGroup collectionGroup,
120             String collectionPropertyName, Object line, Field field, String propertyName, Person user) {
121         return true;
122     }
123 
124     @Override
125     public boolean canPerformLineAction(View view, ViewModel model, CollectionGroup collectionGroup,
126             String collectionPropertyName, Object line, Action action, String actionEvent, String actionId,
127             Person user) {
128         return true;
129     }
130 
131 }