Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Web/Helpers/BillingFilterActionAttribute.cs @ 12817

Last change on this file since 12817 was 9586, checked in by fschoepp, 11 years ago

#1888:

  • Billing Component may now be deactivated by setting the BillingEnabled flag within the OaaS service configuration.
  • Added views for invoices and usage data.
  • Changed appearance of the SaveOrder view.
File size: 679 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Web;
5using System.Web.Mvc;
6
7namespace HeuristicLab.Services.Optimization.Web.Helpers {
8  public class BillingFilterActionAttribute : ActionFilterAttribute {
9    public override void OnActionExecuting(ActionExecutingContext filterContext) {
10      var values = filterContext.RequestContext.RouteData.Values;
11      var controller = values["controller"];
12
13      if (!BillingComponent.Enabled) {
14        // don't allow access to controllers with this name
15        filterContext.Result = new HttpStatusCodeResult(404);
16      }
17      base.OnActionExecuting(filterContext);
18    }
19  }
20}
Note: See TracBrowser for help on using the repository browser.