1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.kpme.tklm.leave.timeoff.authorization;
17
18 import java.util.Map;
19
20 import org.apache.commons.lang.StringUtils;
21 import org.kuali.kpme.core.authorization.KPMEMaintenanceDocumentAuthorizerBase;
22 import org.kuali.kpme.core.role.KPMERoleMemberAttribute;
23 import org.kuali.kpme.tklm.leave.timeoff.SystemScheduledTimeOff;
24
25 @SuppressWarnings("deprecation")
26 public class SystemScheduledTimeOffAuthorizer extends KPMEMaintenanceDocumentAuthorizerBase {
27
28 private static final long serialVersionUID = -3103190348658150171L;
29
30 protected void addRoleQualification(Object dataObject, Map<String, String> attributes) {
31 super.addRoleQualification(dataObject, attributes);
32
33 String location = StringUtils.EMPTY;
34
35 if (dataObject instanceof SystemScheduledTimeOff) {
36 SystemScheduledTimeOff systemScheduledTimeOffObj = (SystemScheduledTimeOff) dataObject;
37
38 if (systemScheduledTimeOffObj != null) {
39 location = systemScheduledTimeOffObj.getLocation();
40 }
41 }
42
43 attributes.put(KPMERoleMemberAttribute.LOCATION.getRoleMemberAttributeName(), location);
44 }
45
46 }