예제 #1
0
        public List <List <CustomerSatSummary> > getSelectedAccountSummaries(int accountId)
        {
            List <List <CustomerSatSummary> > returnData = new List <List <CustomerSatSummary> >();
            bool rights = authRepo.getAdminRights() || authRepo.getTeamLeadRights(accountId);
            bool b      = authRepo.getAccountRights(accountId);

            Debug.WriteLine("CustomerSumAuth " + b + " " + authRepo.getAdminRights() + " " + authRepo.getTeamLeadRights(accountId));
            if (rights || b)
            {
                returnData = repo.getSelectedAccountSummaries(accountId);
            }
            return(repo.getSelectedAccountSummaries(accountId));
        }
        public HttpResponseMessage getSelectedAccountSummaries(int accountId)
        {
            List <List <CustomerSatSummary> > returnData = new List <List <CustomerSatSummary> >();
            bool rights = authRepo.getAdminRights() || authRepo.getTeamLeadRights(accountId);
            bool b      = authRepo.getAccountRights(accountId);

            Debug.WriteLine("CustomerSumAuth " + b + " " + authRepo.getAdminRights() + " " + authRepo.getTeamLeadRights(accountId));
            if (authRepo.isAuthorized(accountId))
            {
                returnData = repo.getSelectedAccountSummaries(accountId);
                return(Request.CreateResponse(HttpStatusCode.OK, returnData));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.Forbidden));
            }
        }