1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krad.service.impl; |
17 | |
|
18 | |
import org.kuali.rice.kim.api.permission.Permission; |
19 | |
import org.kuali.rice.kim.impl.permission.PermissionBo; |
20 | |
import org.kuali.rice.kim.util.KimConstants; |
21 | |
|
22 | |
import java.util.ArrayList; |
23 | |
import java.util.List; |
24 | |
import java.util.Map; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | 0 | public class DocumentTypeAndAttachmentTypePermissionTypeService extends |
30 | |
DocumentTypePermissionTypeServiceImpl { |
31 | |
|
32 | |
@Override |
33 | |
public List<Permission> performPermissionMatches( |
34 | |
Map<String, String> requestedDetails, |
35 | |
List<Permission> permissionsList) { |
36 | |
|
37 | 0 | List<Permission> matchingPermissions = new ArrayList<Permission>(); |
38 | 0 | if (requestedDetails == null) { |
39 | 0 | return matchingPermissions; |
40 | |
} |
41 | |
|
42 | 0 | for (Permission kimPermissionInfo : permissionsList) { |
43 | 0 | PermissionBo bo = PermissionBo.from(kimPermissionInfo); |
44 | 0 | if (!bo.getDetails().containsKey( |
45 | |
KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE) |
46 | |
|| bo.getDetails().get(KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE) |
47 | |
.equals(requestedDetails.get(KimConstants.AttributeConstants.ATTACHMENT_TYPE_CODE))) |
48 | |
{ |
49 | 0 | matchingPermissions.add(kimPermissionInfo); |
50 | |
} |
51 | |
|
52 | 0 | } |
53 | |
|
54 | 0 | matchingPermissions = super.performPermissionMatches(requestedDetails, |
55 | |
matchingPermissions); |
56 | 0 | return matchingPermissions; |
57 | |
} |
58 | |
} |