Fixing the user based policies

4.x.x
geethkokila 10 years ago
parent f7abe86e3c
commit 009c9dd6df

@ -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);

Loading…
Cancel
Save