public static string GetCustomerActions(RestCommand command, int ticketID) { TicketsViewItem ticket = TicketsView.GetTicketsViewItemByIdOrNumberForCustomer(command.LoginUser, (int)command.Organization.ParentID, ticketID); if (ticket.OrganizationID != command.Organization.ParentID || !ticket.GetIsCustomer(command.Organization.OrganizationID)) { throw new RestException(HttpStatusCode.Unauthorized); } ActionsView actions = new ActionsView(command.LoginUser); actions.LoadByTicketID(ticket.TicketID); return(actions.GetXml("Actions", "Action", true, command.Filters)); }
// Customer Only Methods public static string GetCustomerTicket(RestCommand command, int ticketID) { TicketsViewItem ticket = TicketsView.GetTicketsViewItemByIdOrNumberForCustomer(command.LoginUser, (int)command.Organization.ParentID, ticketID); if (ticket.OrganizationID != command.Organization.ParentID || !ticket.GetIsCustomer(command.Organization.OrganizationID)) { throw new RestException(HttpStatusCode.Unauthorized); } Tags tags = new Tags(command.LoginUser); tags.LoadByReference(ReferenceType.Tickets, ticket.TicketID, command.Organization.ParentID); return(ticket.GetXml("Ticket", true, tags)); }