Ejemplo n.º 1
0
        public IHttpActionResult GetPrivilages(Guid webPageId, Guid recordOwnerId, Guid OwningBranchId, Guid salesExecutiveId)
        {
            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.GetEntityPermission(webRoleId, webPageId, recordOwnerId, OwningBranchId, salesExecutiveId);
                            return(Ok(result));
                        }
                    }
                }
                return(NotFound());
            }
            catch (Exception e)
            {
                return(InternalServerError(e));
            }
        }
Ejemplo n.º 2
0
        public Privileges GetEntityPermission(Guid webRoleId, Guid webPageId, Guid recordOwnerId, Guid OwningBranchId, Guid salesExecutiveId)
        {
            var service = new XrmServiceContext(_conn);

            return(service.GetEntityPermission(webRoleId, webPageId, recordOwnerId, OwningBranchId, salesExecutiveId));
        }