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().
|
Policy policy = PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint().
|
||||||
getEffectivePolicy(deviceIdentifier);
|
getEffectivePolicy(deviceIdentifier);
|
||||||
|
|
||||||
List<ProfileFeature> effectiveFeatures =policy.getProfile().getProfileFeaturesList();
|
if (policy != null) {
|
||||||
|
|
||||||
|
List<ProfileFeature> effectiveFeatures = policy.getProfile().getProfileFeaturesList();
|
||||||
|
|
||||||
PolicyOperation policyOperation = new PolicyOperation();
|
PolicyOperation policyOperation = new PolicyOperation();
|
||||||
|
|
||||||
@ -106,8 +108,9 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
|
|||||||
|
|
||||||
PolicyManagementDataHolder.getInstance().getDeviceManagementService().
|
PolicyManagementDataHolder.getInstance().getDeviceManagementService().
|
||||||
addOperation(policyOperation, deviceIdentifiers);
|
addOperation(policyOperation, deviceIdentifiers);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return policy;
|
return policy;
|
||||||
} catch (PolicyEvaluationException e) {
|
} catch (PolicyEvaluationException e) {
|
||||||
@ -131,6 +134,7 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
|
|||||||
List<ProfileFeature> effectiveFeatures = PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint().
|
List<ProfileFeature> effectiveFeatures = PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint().
|
||||||
getEffectiveFeatures(deviceIdentifier);
|
getEffectiveFeatures(deviceIdentifier);
|
||||||
|
|
||||||
|
if (!effectiveFeatures.isEmpty()) {
|
||||||
PolicyOperation policyOperation = new PolicyOperation();
|
PolicyOperation policyOperation = new PolicyOperation();
|
||||||
|
|
||||||
List<ProfileOperation> profileOperationList = new ArrayList<ProfileOperation>();
|
List<ProfileOperation> profileOperationList = new ArrayList<ProfileOperation>();
|
||||||
@ -149,6 +153,9 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
|
|||||||
|
|
||||||
PolicyManagementDataHolder.getInstance().getDeviceManagementService().
|
PolicyManagementDataHolder.getInstance().getDeviceManagementService().
|
||||||
addOperation(policyOperation, deviceIdentifiers);
|
addOperation(policyOperation, deviceIdentifiers);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return effectiveFeatures;
|
return effectiveFeatures;
|
||||||
} catch (PolicyEvaluationException e) {
|
} catch (PolicyEvaluationException e) {
|
||||||
|
|||||||
@ -39,6 +39,9 @@ public class PolicyFilterImpl implements PolicyFilter {
|
|||||||
for (Policy policy : policies) {
|
for (Policy policy : policies) {
|
||||||
|
|
||||||
List<String> tempRoles = policy.getRoles();
|
List<String> tempRoles = policy.getRoles();
|
||||||
|
if (tempRoles == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (PolicyManagementConstants.ANY.equalsIgnoreCase(tempRoles.get(0))) {
|
if (PolicyManagementConstants.ANY.equalsIgnoreCase(tempRoles.get(0))) {
|
||||||
temp.add(policy);
|
temp.add(policy);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -55,8 +55,11 @@ public class SimpleEvaluationImpl implements SimpleEvaluation {
|
|||||||
policyList = policyInformationPoint.getRelatedPolicies(pipDevice);
|
policyList = policyInformationPoint.getRelatedPolicies(pipDevice);
|
||||||
|
|
||||||
sortPolicies();
|
sortPolicies();
|
||||||
|
if(!policyList.isEmpty()) {
|
||||||
policy = policyList.get(0);
|
policy = policyList.get(0);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
//TODO : UNCOMMENT THE FOLLOWING CASE
|
//TODO : UNCOMMENT THE FOLLOWING CASE
|
||||||
// policyAdministratorPoint = policyManagerService.getPAP();
|
// policyAdministratorPoint = policyManagerService.getPAP();
|
||||||
// policyAdministratorPoint.setPolicyUsed(deviceIdentifier, policy);
|
// policyAdministratorPoint.setPolicyUsed(deviceIdentifier, policy);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user