1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.service.impl; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
|
21 | |
import org.kuali.rice.kim.bo.impl.KimAttributes; |
22 | |
import org.kuali.rice.kim.bo.role.dto.KimPermissionInfo; |
23 | |
import org.kuali.rice.kim.bo.types.dto.AttributeSet; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | 0 | public class DocumentTypeAndEditModePermissionTypeServiceImpl extends DocumentTypePermissionTypeServiceImpl { |
29 | |
|
30 | |
{ |
31 | 0 | requiredAttributes.add(KimAttributes.EDIT_MODE); |
32 | 0 | } |
33 | |
|
34 | |
@Override |
35 | |
protected List<KimPermissionInfo> performPermissionMatches( |
36 | |
AttributeSet requestedDetails, |
37 | |
List<KimPermissionInfo> permissionsList) { |
38 | 0 | List<KimPermissionInfo> matchingPermissions = new ArrayList<KimPermissionInfo>(); |
39 | 0 | for (KimPermissionInfo kimPermissionInfo : permissionsList) { |
40 | 0 | if (requestedDetails.get(KimAttributes.EDIT_MODE).equals(kimPermissionInfo.getDetails().get(KimAttributes.EDIT_MODE))) { |
41 | 0 | matchingPermissions.add(kimPermissionInfo); |
42 | |
} |
43 | |
} |
44 | 0 | return super.performPermissionMatches(requestedDetails, matchingPermissions); |
45 | |
} |
46 | |
} |