1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.service.impl; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import org.apache.commons.lang.StringUtils; |
22 | |
import org.kuali.rice.core.util.AttributeSet; |
23 | |
import org.kuali.rice.kim.bo.role.dto.KimPermissionInfo; |
24 | |
import org.kuali.rice.kim.service.support.KimPermissionTypeService; |
25 | |
import org.kuali.rice.kim.util.KimConstants; |
26 | |
import org.kuali.rice.kns.service.impl.DocumentTypePermissionTypeServiceImpl; |
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | 0 | public class AdhocReviewPermissionTypeServiceImpl extends DocumentTypePermissionTypeServiceImpl implements KimPermissionTypeService{ |
36 | |
|
37 | |
{ |
38 | 0 | requiredAttributes.add( KimConstants.AttributeConstants.ACTION_REQUEST_CD ); |
39 | 0 | } |
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
@Override |
46 | |
public List<KimPermissionInfo> performPermissionMatches( |
47 | |
AttributeSet requestedDetails, |
48 | |
List<KimPermissionInfo> permissionsList) { |
49 | 0 | List<KimPermissionInfo> matchingPermissions = new ArrayList<KimPermissionInfo>(); |
50 | 0 | if (requestedDetails == null) { |
51 | 0 | return matchingPermissions; |
52 | |
} |
53 | |
|
54 | 0 | for (KimPermissionInfo kpi : permissionsList) { |
55 | 0 | if (!kpi.getDetails().containsKey(KimConstants.AttributeConstants.ACTION_REQUEST_CD) |
56 | |
|| StringUtils.equals(kpi.getDetails(). |
57 | |
get(KimConstants.AttributeConstants.ACTION_REQUEST_CD), requestedDetails |
58 | |
.get(KimConstants.AttributeConstants.ACTION_REQUEST_CD))) { |
59 | 0 | matchingPermissions.add(kpi); |
60 | |
} |
61 | |
} |
62 | |
|
63 | 0 | matchingPermissions = super.performPermissionMatches(requestedDetails, |
64 | |
matchingPermissions); |
65 | 0 | return matchingPermissions; |
66 | |
} |
67 | |
} |