1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.doctype; |
17 | |
|
18 | |
import org.kuali.rice.core.reflect.ObjectDefinition; |
19 | |
import org.kuali.rice.core.resourceloader.GlobalResourceLoader; |
20 | |
import org.kuali.rice.kim.bo.Person; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
public class LazyLoadSecurityAttribute implements SecurityAttribute { |
33 | |
|
34 | |
private static final long serialVersionUID = 8194757786570696656L; |
35 | |
|
36 | |
private String className; |
37 | |
private String serviceNamespace; |
38 | |
|
39 | 0 | public LazyLoadSecurityAttribute(String className, String serviceNamespace) { |
40 | 0 | this.className = className; |
41 | 0 | this.serviceNamespace = serviceNamespace; |
42 | 0 | } |
43 | |
|
44 | |
public Boolean docSearchAuthorized(Person currentUser, String docTypeName, |
45 | |
Long documentId, String initiatorPrincipalId) { |
46 | 0 | return getSecurityAttribute().docSearchAuthorized(currentUser, docTypeName, documentId, initiatorPrincipalId); |
47 | |
} |
48 | |
|
49 | |
public Boolean routeLogAuthorized(Person currentUser, String docTypeName, |
50 | |
Long documentId, String initiatorPrincipalId) { |
51 | 0 | return getSecurityAttribute().routeLogAuthorized(currentUser, docTypeName, documentId, initiatorPrincipalId); |
52 | |
} |
53 | |
|
54 | |
protected SecurityAttribute getSecurityAttribute() { |
55 | 0 | ObjectDefinition objDef = new ObjectDefinition(className, serviceNamespace); |
56 | 0 | return (SecurityAttribute)GlobalResourceLoader.getObject(objDef); |
57 | |
} |
58 | |
|
59 | |
} |