|
|
|
@ -63,13 +63,14 @@ public class PolicyFilterImpl implements PolicyFilter {
|
|
|
|
|
@Override
|
|
|
|
|
public void filterOwnershipTypeBasedPolicies(String ownershipType, List<Policy> policies) {
|
|
|
|
|
|
|
|
|
|
// List<Policy> temp = new ArrayList<Policy>();
|
|
|
|
|
// for (Policy policy : policies) {
|
|
|
|
|
// if (ownershipType.equalsIgnoreCase(policy.getOwnershipType())) {
|
|
|
|
|
// temp.add(policy);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// policies = temp;
|
|
|
|
|
List<Policy> temp = new ArrayList<Policy>();
|
|
|
|
|
for (Policy policy : policies) {
|
|
|
|
|
if (ownershipType.equalsIgnoreCase(policy.getOwnershipType()) ||
|
|
|
|
|
PolicyManagementConstants.ANY.equalsIgnoreCase(policy.getOwnershipType())) {
|
|
|
|
|
temp.add(policy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
policies = temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -89,6 +90,10 @@ public class PolicyFilterImpl implements PolicyFilter {
|
|
|
|
|
|
|
|
|
|
for (Policy policy : policies) {
|
|
|
|
|
List<String> users = policy.getUsers();
|
|
|
|
|
if(users.contains(PolicyManagementConstants.ANY)) {
|
|
|
|
|
temp.add(policy);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (String user : users) {
|
|
|
|
|
if(usernames.contains(user)) {
|
|
|
|
|
temp.add(policy);
|
|
|
|
|