Beispiel #1
0
        public ActionResult UpdateFlags(int projectId, bool allowDirectPublish, bool allowPackageUpload)
        {
            if (!CurrentUserModel.IsAdmin)
            {
                throw new Exception("Unauthorised");
            }

            ProjectFlag flags = ProjectFlag.None;

            if (allowDirectPublish)
            {
                flags |= ProjectFlag.AllowDirectPublish;
            }
            if (allowPackageUpload)
            {
                flags |= ProjectFlag.AllowPackageUpload;
            }
            CurrentUserModel.UpdateProjectFlags(projectId, flags);
            return(RedirectToAction("Index", new { id = projectId }));
        }