Fixing issue on group permission validating

merge-requests/7/head
Rasika Perera 9 years ago
parent 4cab2b5504
commit 5c680b3f65

@ -38,6 +38,7 @@ import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -186,10 +187,14 @@ public class DeviceAccessAuthorizationServiceImpl implements DeviceAccessAuthori
DeviceManagementDataHolder.getInstance().getGroupManagementProviderService() DeviceManagementDataHolder.getInstance().getGroupManagementProviderService()
.getGroups(deviceIdentifier); .getGroups(deviceIdentifier);
for (DeviceGroup group : authorizedGroups) { for (DeviceGroup group : authorizedGroups) {
if (groupsWithDevice.contains(group)) { Iterator<DeviceGroup> groupsWithDeviceIterator = groupsWithDevice.iterator();
while (groupsWithDeviceIterator.hasNext()) {
DeviceGroup deviceGroup = groupsWithDeviceIterator.next();
if (deviceGroup.getId() == group.getId()) {
return true; return true;
} }
} }
}
return false; return false;
} }

Loading…
Cancel
Save