Beispiel #1
0
        public IActionResult Organization(string Id)
        {
            var projectId = default(int);

            using (var context = new DatabaseController(Context, Configuration))
                projectId = context.GetProjectByOrganization(Id);

            if (projectId == 0)
            {
                return(View("Error"));
            }

            ViewData["ProjectId"] = projectId;

            if (UserId == 0)
            {
                var canView = default(bool);
                using (var context = new DocumentationContext(Context, Configuration))
                    canView = context.CheckDocumentationPublicAccess(projectId);
                if (!canView)
                {
                    return(View("Error"));
                }
            }
            using (var context = new UsersContext(Context, Configuration))
                ViewData["UserRights"] = context.GetUserRights(UserId, projectId);

            return(View("~/Views/Documentation/Index.cshtml"));
        }
Beispiel #2
0
        public IActionResult Index(int Id)
        {
            ViewData["ProjectId"] = Id;
            if (UserId == 0)
            {
                var canView = default(bool);
                using (var context = new DocumentationContext(Context, Configuration))
                    canView = context.CheckDocumentationPublicAccess(Id);
                if (!canView)
                {
                    return(View("Error"));
                }
            }
            using (var context = new UsersContext(Context, Configuration))
                ViewData["UserRights"] = context.GetUserRights(UserId, Id);

            return(View());
        }