/// <summary> /// Creates a new PrincipalsController given the user provider and principal service. /// </summary> /// <param name="handler">The resource authorization handler.</param> /// <param name="resourceService">The resource service.</param> public PrincipalsController(IResourceAuthorizationHandler handler, IResourceService resourceService) { Contract.Requires(handler != null, "The handler must not be null."); Contract.Requires(resourceService != null, "The resource service must not be null."); this.handler = handler; this.resourceService = resourceService; }
/// <summary> /// Creates a new ProjectsController with the given project service. /// </summary> /// <param name="projectService">The project service.</param> /// <param name="authorizationHandler">The authorization handler.</param> /// <param name="userProvider">The user provider.</param> /// <param name="resourceService">The resource service.</param> public ProjectsController( IProjectService projectService, IResourceAuthorizationHandler authorizationHandler, IUserProvider userProvider, IResourceService resourceService) { Contract.Requires(projectService != null, "The project service must not be null."); Contract.Requires(userProvider != null, "The user provider must not be null."); Contract.Requires(authorizationHandler != null, "The authorization handler must not be null."); Contract.Requires(resourceService != null, "The resource service must not be null."); this.projectService = projectService; this.resourceService = resourceService; this.authorizationHandler = authorizationHandler; this.userProvider = userProvider; }
/// <summary> /// Creates a new controller instance. /// </summary> /// <param name="service">The service.</param> /// <param name="focusCategoryService">The focus category service.</param> /// <param name="justificationObjectiveService">The justification objective service.</param> /// <param name="authorizationHandler"></param> /// <param name="resourceService"></param> /// <param name="userProvider"></param> public OfficesController(IOfficeService service, IFocusCategoryService focusCategoryService, IJustificationObjectiveService justificationObjectiveService, IResourceService resourceService, IResourceAuthorizationHandler authorizationHandler, IUserProvider userProvider) { Contract.Requires(service != null, "The office service must not be null."); Contract.Requires(focusCategoryService != null, "The focus category service must not be null."); Contract.Requires(justificationObjectiveService != null, "The justification service must not be null."); Contract.Requires(resourceService != null, "The resource service must not be null."); Contract.Requires(authorizationHandler != null, "The authorization handler must not be null."); Contract.Requires(userProvider != null, "The authorization handler must not be null."); this.service = service; this.focusCategoryService = focusCategoryService; this.justificationObjectiveService = justificationObjectiveService; this.resourceService = resourceService; this.authorizationHandler = authorizationHandler; this.userProvider = userProvider; }
/// <summary> /// Creates a new ProgramController with the given program service. /// </summary> /// <param name="programService">The program service.</param> /// <param name="userProvider">The user provider.</param> /// <param name="categoryService">The focus category service.</param> /// <param name="resourceService">The resource service.</param> /// <param name="justificationObjectiveService">The justification objective service.</param> /// <param name="authorizationHandler">the authorization handler service.</param> public ProgramsController(IProgramService programService, IUserProvider userProvider, IFocusCategoryService categoryService, IJustificationObjectiveService justificationObjectiveService, IResourceService resourceService, IResourceAuthorizationHandler authorizationHandler) { Contract.Requires(programService != null, "The program service must not be null."); Contract.Requires(userProvider != null, "The user provider must not be null."); Contract.Requires(categoryService != null, "The category service must not be null."); Contract.Requires(justificationObjectiveService != null, "The justification service must not be null."); Contract.Requires(resourceService != null, "The resource service must not be null."); Contract.Requires(authorizationHandler != null, "The authorization handler must not be null."); this.programService = programService; this.userProvider = userProvider; this.categoryService = categoryService; this.justificationObjectiveService = justificationObjectiveService; this.resourceService = resourceService; this.authorizationHandler = authorizationHandler; }