1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.purap.document.web.struts;
17
18 import org.apache.struts.action.ActionForm;
19 import org.kuali.ole.sys.context.SpringContext;
20 import org.kuali.rice.kim.api.services.IdentityManagementService;
21 import org.kuali.rice.kns.service.KNSServiceLocator;
22 import org.kuali.rice.kns.web.struts.action.KualiLookupAction;
23 import org.kuali.rice.kns.web.struts.form.LookupForm;
24 import org.kuali.rice.krad.util.GlobalVariables;
25
26 import java.util.HashMap;
27
28 public class KualiLookupActions extends KualiLookupAction {
29
30
31 public void supressActionsIfNeeded(ActionForm form) throws ClassNotFoundException {
32 Class businessObjectClass = Class.forName(((LookupForm) form).getBusinessObjectClassName());
33 HashMap<String, String> permissionDetails = new HashMap<String, String>();
34 String nameSpaceCode = "OLE-VND";
35 if (businessObjectClass.getName().equalsIgnoreCase("org.kuali.ole.vnd.businessobject.VendorDetail")) {
36 if ((SpringContext.getBean(IdentityManagementService.class).hasPermission(GlobalVariables.getUserSession().getPerson().getPrincipalId(), nameSpaceCode,
37 "Edit Vendor"))) {
38
39 if (!KNSServiceLocator.getDocumentHelperService().getDocumentAuthorizer("OLE_PVEN").canInitiate("OLE_PVEN", GlobalVariables.getUserSession().getPerson())) {
40 ((LookupForm) form).setSupplementalActionsEnabled(true);
41 } else {
42
43 }
44 } else {
45
46 System.out.println("aefasfasdfsadfsdaf");
47 }
48 } else {
49 System.out.println("else part");
50
51 }
52 }
53 }
54
55
56
57
58