public IHttpActionResult GetEntityGridPrivilages(String entityName, Guid recordOwnerId, Guid OwningBranchId) { try { var context = HttpContext.Current; Guid webRoleId = new Guid(); if (context != null) { var request = context.Request.RequestContext; var cookies = request.HttpContext.Request.Cookies; if (cookies != null) { if (cookies["Branch"] != null) { webRoleId = new Guid(cookies["Branch"]["webRoleId"]); var service = new XrmServiceContext(_conn); var result = service.GetEditableGridEntityPermission(webRoleId, entityName, recordOwnerId, OwningBranchId); return(Ok(result)); } } } return(NotFound()); } catch (Exception e) { return(InternalServerError(e)); } }
public Privileges GetEditableGridEntityPermission(Guid webRoleId, String entityName, Guid recordOwnerId, Guid OwningBranchId) { var service = new XrmServiceContext(_conn); return(service.GetEditableGridEntityPermission(webRoleId, entityName, recordOwnerId, OwningBranchId)); }