1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.authorizer;
17
18 import org.kuali.rice.kim.api.identity.Person;
19 import org.kuali.rice.krad.inquiry.InquiryViewAuthorizerBase;
20 import org.kuali.rice.krad.uif.container.Group;
21 import org.kuali.rice.krad.uif.field.DataField;
22 import org.kuali.rice.krad.uif.field.Field;
23 import org.kuali.rice.krad.uif.view.View;
24 import org.kuali.rice.krad.uif.view.ViewModel;
25
26
27
28
29
30
31
32
33 public class DemoInquiryViewAuthorizer extends InquiryViewAuthorizerBase {
34
35 @Override
36 public boolean canViewField(View view, ViewModel model, Field field, String propertyName, Person user)
37 {
38
39 if(propertyName.equals("travelAuthorizationDocumentId") &&
40 user.getPrincipalName().equals("admin")) {
41 return false;
42 }
43
44 return super.canViewField(view,model,field,propertyName,user);
45 }
46
47 @Override
48 public boolean canViewGroup(View view, ViewModel model, Group group, String groupId, Person user) {
49
50
51 if(groupId.equals("TravelAccount-InquiryView-Costs") &&
52 user.getPrincipalName().equals("admin")) {
53 return false;
54 }
55
56 return super.canViewGroup(view,model,group,groupId,user);
57 }
58
59
60
61
62
63 }