public ICollection <AccessControlPolicy> Review(JObject user, JObject resource, JObject environment) { var policies = _accessControlPolicyRepository.GetAll(); var result = new List <AccessControlPolicy>(); foreach (var policy in policies) { if (_expressionService.IsAccessControlPolicyRelateToContext(policy, user, resource, environment)) { result.Add(policy); } } return(result); }
public IEnumerable <AccessControlPolicyViewModel> AccessControlPolicy() { var accessControlPolicies = _accessControlPolicyRepository.GetAll(); var result = new List <AccessControlPolicyViewModel>(); foreach (var policy in accessControlPolicies) { result.Add(new AccessControlPolicyViewModel() { PolicyId = policy.PolicyId, Action = policy.Action, CollectionName = policy.Action, Description = policy.Description, IsAttributeResourceRequired = policy.IsAttributeResourceRequired, RuleCombining = policy.RuleCombining, Target = FunctionUtility.Convert(policy.Target) }); } return(result); }