Exemple #1
0
        public async Task <IEnumerable <IPermissionState> > GetChildrenAsync(string parentId, ICriterion filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null)
        {
            IEnumerable <IPermissionState> states = null;
            var q           = new PermissionTreesGetQuery();
            var parentIdObj = (parentId);

            q.ParentId    = parentIdObj;
            q.FirstResult = firstResult;
            q.MaxResults  = maxResults;
            q.Sort        = PermissionProxyUtils.GetOrdersQueryValueString(orders);
            q.Fields      = PermissionProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator);
            q.Filter      = PermissionProxyUtils.GetFilterQueryValueString(filter);
            var req = new PermissionTreesGetRequest();

            req.Query = q;
            var resp = await _ramlClient.PermissionTrees.Get(req);

            PermissionProxyUtils.ThrowOnHttpResponseError(resp);
            states = resp.Content;
            return(states);
        }