mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt
This commit is contained in:
commit
7b9dba545a
@ -86,7 +86,9 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
|
||||
Policy policy = PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint().
|
||||
getEffectivePolicy(deviceIdentifier);
|
||||
|
||||
List<ProfileFeature> effectiveFeatures =policy.getProfile().getProfileFeaturesList();
|
||||
if (policy != null) {
|
||||
|
||||
List<ProfileFeature> effectiveFeatures = policy.getProfile().getProfileFeaturesList();
|
||||
|
||||
PolicyOperation policyOperation = new PolicyOperation();
|
||||
|
||||
@ -106,8 +108,9 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
|
||||
|
||||
PolicyManagementDataHolder.getInstance().getDeviceManagementService().
|
||||
addOperation(policyOperation, deviceIdentifiers);
|
||||
|
||||
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return policy;
|
||||
} catch (PolicyEvaluationException e) {
|
||||
@ -131,6 +134,7 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
|
||||
List<ProfileFeature> effectiveFeatures = PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint().
|
||||
getEffectiveFeatures(deviceIdentifier);
|
||||
|
||||
if (!effectiveFeatures.isEmpty()) {
|
||||
PolicyOperation policyOperation = new PolicyOperation();
|
||||
|
||||
List<ProfileOperation> profileOperationList = new ArrayList<ProfileOperation>();
|
||||
@ -149,6 +153,9 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
|
||||
|
||||
PolicyManagementDataHolder.getInstance().getDeviceManagementService().
|
||||
addOperation(policyOperation, deviceIdentifiers);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
return effectiveFeatures;
|
||||
} catch (PolicyEvaluationException e) {
|
||||
|
||||
@ -39,6 +39,9 @@ public class PolicyFilterImpl implements PolicyFilter {
|
||||
for (Policy policy : policies) {
|
||||
|
||||
List<String> tempRoles = policy.getRoles();
|
||||
if (tempRoles == null) {
|
||||
continue;
|
||||
}
|
||||
if (PolicyManagementConstants.ANY.equalsIgnoreCase(tempRoles.get(0))) {
|
||||
temp.add(policy);
|
||||
continue;
|
||||
|
||||
@ -55,8 +55,11 @@ public class SimpleEvaluationImpl implements SimpleEvaluation {
|
||||
policyList = policyInformationPoint.getRelatedPolicies(pipDevice);
|
||||
|
||||
sortPolicies();
|
||||
if(!policyList.isEmpty()) {
|
||||
policy = policyList.get(0);
|
||||
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
//TODO : UNCOMMENT THE FOLLOWING CASE
|
||||
// policyAdministratorPoint = policyManagerService.getPAP();
|
||||
// policyAdministratorPoint.setPolicyUsed(deviceIdentifier, policy);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user