Skip to content
Snippets Groups Projects
Select Git revision
  • 15557185d0d5628505f515dfbe28cec966a438ea
  • master default protected
  • gitkeep
  • dev protected
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/2309-docs
  • Issue/2355-topLevelOrg
  • Issue/2328-noFailOnLog
  • Hotfix/2371-fixGitLabinRCV
  • Issue/2287-guestRole
  • Fix/xxxx-activateGitlab
  • Test/xxxx-enablingGitLab
  • Issue/2349-gitlabHttps
  • Issue/2259-updatePids
  • Issue/2101-gitLabResTypeUi
  • Hotfix/2202-fixNaNQuota
  • Issue/2246-quotaResoval
  • Issue/2221-projectDateCreated
  • Hotfix/2224-quotaSizeAnalytics
  • Fix/xxxx-resourceVisibility
  • Issue/2000-gitlabResourcesAPI
  • v4.4.3
  • v4.4.2
  • v4.4.1
  • v4.4.0
  • v4.3.4
  • v4.3.3
  • v4.3.2
  • v4.3.1
  • v4.3.0
  • v4.2.8
  • v4.2.7
  • v4.2.6
  • v4.2.5
  • v4.2.4
  • v4.2.3
  • v4.2.2
  • v4.2.1
  • v4.2.0
  • v4.1.1
  • v4.1.0
41 results

ProjectController.cs

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ProjectController.cs 31.54 KiB
    using Coscine.Action;
    using Coscine.Action.EventArgs;
    using Coscine.Action.Utils;
    using Coscine.Api.Project.ParameterObjects;
    using Coscine.ApiCommons;
    using Coscine.Configuration;
    using Coscine.Database.DataModel;
    using Coscine.Database.Models;
    using Coscine.Database.ReturnObjects;
    using Coscine.Database.Util;
    using Coscine.Logging;
    using Coscine.Metadata;
    using Coscine.ResourceTypes;
    using Microsoft.AspNetCore.Authorization;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.Extensions.Logging;
    using Newtonsoft.Json.Linq;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    
    namespace Coscine.Api.Project.Controllers
    {
        /// <summary>
        /// This controller represents the actions which can be taken with a project object.
        /// </summary>
        [Authorize]
        public class ProjectController : Controller
        {
            private readonly Authenticator _authenticator;
            private readonly ProjectModel _projectModel;
            private readonly IConfiguration _configuration;
            private readonly Emitter _emitter;
            private readonly ActivatedFeaturesModel _activatedFeaturesModel;
            private readonly ProjectRoleModel _projectRoleModel;
            private readonly ProjectQuotaModel _projectQuotaModel;
            private readonly ResourceTypeModel _resourceTypeModel;
            private readonly CoscineLogger _coscineLogger;
            private readonly VisibilityModel _visibilityModel;
            private readonly InvitationModel _invitationModel;
            private readonly RoleModel _roleModel;
            private readonly UserModel _userModel;
            private readonly RdfStoreConnector _rdfStoreConnector;
    
            /// <summary>
            /// ProjectController constructor
            /// </summary>
            /// <param name="logger">Logger</param>
            public ProjectController(ILogger<ProjectController> logger)
            {
                _authenticator = new Authenticator(this, Program.Configuration);
                _configuration = Program.Configuration;
                _projectModel = new ProjectModel();
                _emitter = new Emitter(_configuration);
                _activatedFeaturesModel = new ActivatedFeaturesModel();
                _projectRoleModel = new ProjectRoleModel();
                _resourceTypeModel = new ResourceTypeModel();
                _projectQuotaModel = new ProjectQuotaModel();
                _coscineLogger = new CoscineLogger(logger);
                _visibilityModel = new VisibilityModel();
                _rdfStoreConnector = new RdfStoreConnector(Program.Configuration.GetString("coscine/local/virtuoso/additional/url"));
                _invitationModel = new InvitationModel();
                _roleModel = new RoleModel();
                _userModel = new UserModel();
            }
    
            /// <summary>
            /// Returns all available projects (including sub projects)
            /// </summary>
            /// <returns>OK</returns>