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 DocumentTypeAndRelationshipToNoteAuthorPermissionTypeService |
31 | |
extends DocumentTypePermissionTypeServiceImpl { |
32 | |
|
33 | |
@Override |
34 | |
protected List<Permission> performPermissionMatches( |
35 | |
Map<String, String> requestedDetails, |
36 | |
List<Permission> permissionsList) { |
37 | |
|
38 | 0 | List<Permission> matchingPermissions = new ArrayList<Permission>(); |
39 | 0 | if (requestedDetails == null) { |
40 | 0 | return matchingPermissions; |
41 | |
} |
42 | |
|
43 | |
|
44 | 0 | for (Permission permission : permissionsList) { |
45 | 0 | PermissionBo bo = PermissionBo.from(permission); |
46 | 0 | if (Boolean.parseBoolean(requestedDetails |
47 | |
.get(KimConstants.AttributeConstants.CREATED_BY_SELF))) { |
48 | 0 | if(Boolean.parseBoolean(bo.getDetails().get( |
49 | |
KimConstants.AttributeConstants.CREATED_BY_SELF_ONLY))){ |
50 | 0 | matchingPermissions.add(permission); |
51 | |
} |
52 | |
|
53 | |
}else{ |
54 | 0 | if (!Boolean.parseBoolean(bo.getDetails().get( |
55 | |
KimConstants.AttributeConstants.CREATED_BY_SELF_ONLY))) { |
56 | 0 | matchingPermissions.add(permission); |
57 | |
} |
58 | |
} |
59 | |
|
60 | 0 | } |
61 | |
|
62 | 0 | matchingPermissions = super.performPermissionMatches(requestedDetails, matchingPermissions); |
63 | 0 | return matchingPermissions; |
64 | |
} |
65 | |
} |