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