public ActionResult ContinuousIntegration(int id, string platform) { Models.PlatformContinuousIntegration mdl = new Models.PlatformContinuousIntegration(); if (!Repository.Managers.ApplicationBuildMgr.IsUserAnAppTeamMemberInRole(User.Identity.GetUserName(), id, Common.Constants.APPLICATION_MEMBER_ROLE_ADMINISTRATOR)) { throw new HttpException(403, "You are not allowed to have access to this app."); } string currentUser = User.Identity.GetUserName().ToLower(); using (var context = new Repository.BetaDepotContext()) { Repository.Application app = context.Applications.Where(w => w.Id == id).FirstOrDefault(); if (app != null) { mdl.AppId = app.Id; mdl.AppName = app.Name; mdl.AppIconUrl = Platforms.Common.GenerateAppIconUrl(app.ApplicationIdentifier); mdl.AppToken = app.AppToken; Repository.TeamMember CIUser = Repository.Managers.ApplicationMgr.GetSystemCIUser(); mdl.IsContinuousIntegrationConfigured = Repository.Managers.ApplicationBuildMgr.IsUserAnAppTeamMember(CIUser.UserName, id); } } return(View(mdl)); }
public ActionResult ContinuousIntegration(int id, string platform) { Models.PlatformContinuousIntegration mdl = new Models.PlatformContinuousIntegration(); if (!Repository.Managers.ApplicationBuildMgr.IsUserAnAppTeamMemberInRole(User.Identity.GetUserName(), id, Common.Constants.APPLICATION_MEMBER_ROLE_ADMINISTRATOR)) throw new HttpException(403, "You are not allowed to have access to this app."); string currentUser = User.Identity.GetUserName().ToLower(); using (var context = new Repository.BetaDepotContext()) { Repository.Application app = context.Applications.Where(w => w.Id == id).FirstOrDefault(); if (app != null) { mdl.AppId = app.Id; mdl.AppName = app.Name; mdl.AppIconUrl = Platforms.Common.GenerateAppIconUrl(app.ApplicationIdentifier); mdl.AppToken = app.AppToken; Repository.TeamMember CIUser = Repository.Managers.ApplicationMgr.GetSystemCIUser(); mdl.IsContinuousIntegrationConfigured = Repository.Managers.ApplicationBuildMgr.IsUserAnAppTeamMember(CIUser.UserName, id); } } return View(mdl); }