Example #1
0
        internal void UpdateProjectFlags(int id, ProjectFlag flags)
        {
            CheckIsAdmin();
            Project p = GetProject(id);

            p.Flags = flags;
            db.UpdateObject(p);
        }
Example #2
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 }));
        }
Example #3
0
 internal void UpdateProjectFlags(int id, ProjectFlag flags)
 {
     CheckIsAdmin ();
     Project p = GetProject (id);
     p.Flags = flags;
     db.UpdateObject (p);
 }
Example #4
0
 public bool HasFlag(ProjectFlag flag)
 {
     return((Flags & flag) == flag);
 }
Example #5
0
 public bool HasFlag(ProjectFlag flag)
 {
     return (Flags & flag) == flag;
 }