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 | |
|
19 | |
import org.kuali.rice.kim.api.permission.Permission; |
20 | |
import org.kuali.rice.kim.impl.permission.PermissionBo; |
21 | |
import org.kuali.rice.kim.util.KimConstants; |
22 | |
|
23 | |
import java.util.ArrayList; |
24 | |
import java.util.List; |
25 | |
import java.util.Map; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | 0 | public class DocumentTypeAndEditModePermissionTypeServiceImpl extends DocumentTypePermissionTypeServiceImpl { |
31 | |
|
32 | |
{ |
33 | 0 | requiredAttributes.add(KimConstants.AttributeConstants.EDIT_MODE); |
34 | 0 | } |
35 | |
|
36 | |
@Override |
37 | |
protected List<Permission> performPermissionMatches( |
38 | |
Map<String, String> requestedDetails, |
39 | |
List<Permission> permissionsList) { |
40 | 0 | List<Permission> matchingPermissions = new ArrayList<Permission>(); |
41 | 0 | for (Permission permission : permissionsList) { |
42 | 0 | PermissionBo bo = PermissionBo.from(permission); |
43 | 0 | if (requestedDetails.get(KimConstants.AttributeConstants.EDIT_MODE).equals(bo.getDetails().get(KimConstants.AttributeConstants.EDIT_MODE))) { |
44 | 0 | matchingPermissions.add(permission); |
45 | |
} |
46 | 0 | } |
47 | 0 | return super.performPermissionMatches(requestedDetails, matchingPermissions); |
48 | |
} |
49 | |
} |