| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.rice.kim.lookup; |
| 17 |
|
|
| 18 |
|
import org.kuali.rice.kim.bo.Person; |
| 19 |
|
import org.kuali.rice.kim.service.KIMServiceLocatorWeb; |
| 20 |
|
import org.kuali.rice.kim.service.KimTypeInfoService; |
| 21 |
|
import org.kuali.rice.kns.document.authorization.DocumentAuthorizer; |
| 22 |
|
import org.kuali.rice.kns.document.authorization.DocumentPresentationController; |
| 23 |
|
import org.kuali.rice.kns.lookup.KualiLookupableHelperServiceImpl; |
| 24 |
|
import org.kuali.rice.kns.service.DocumentHelperService; |
| 25 |
|
import org.kuali.rice.kns.service.KNSServiceLocatorWeb; |
| 26 |
|
import org.kuali.rice.kns.util.GlobalVariables; |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
@author |
| 32 |
|
|
| 33 |
|
|
|
|
|
| 0% |
Uncovered Elements: 17 (17) |
Complexity: 5 |
Complexity Density: 0.5 |
|
| 34 |
|
public class KimLookupableHelperServiceImpl extends KualiLookupableHelperServiceImpl { |
| 35 |
|
|
| 36 |
|
private static final long serialVersionUID = 1L; |
| 37 |
|
|
| 38 |
|
private static DocumentHelperService documentHelperService; |
| 39 |
|
private static KimTypeInfoService typeInfoService; |
| 40 |
|
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
| 41 |
0
|
@Override... |
| 42 |
|
public boolean allowsNewOrCopyAction(String documentTypeName) { |
| 43 |
|
|
| 44 |
0
|
DocumentAuthorizer documentAuthorizer = getDocumentHelperService().getDocumentAuthorizer(documentTypeName); |
| 45 |
0
|
DocumentPresentationController documentPresentationController = getDocumentHelperService().getDocumentPresentationController(documentTypeName); |
| 46 |
|
|
| 47 |
0
|
Person currentUser = GlobalVariables.getUserSession().getPerson(); |
| 48 |
0
|
return documentPresentationController.canInitiate(documentTypeName) && documentAuthorizer.canInitiate(documentTypeName, currentUser); |
| 49 |
|
|
| 50 |
|
} |
| 51 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 52 |
0
|
protected DocumentHelperService getDocumentHelperService() {... |
| 53 |
0
|
if ( documentHelperService == null ) { |
| 54 |
0
|
documentHelperService = KNSServiceLocatorWeb.getDocumentHelperService(); |
| 55 |
|
} |
| 56 |
0
|
return documentHelperService; |
| 57 |
|
} |
| 58 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 59 |
0
|
protected KimTypeInfoService getTypeInfoService() {... |
| 60 |
0
|
if ( typeInfoService == null ) { |
| 61 |
0
|
typeInfoService = KIMServiceLocatorWeb.getTypeInfoService(); |
| 62 |
|
} |
| 63 |
0
|
return typeInfoService; |
| 64 |
|
} |
| 65 |
|
} |