Permissions & Authorization for Users #24

Initial Release; Includes Database and MVC refactoring
This commit is contained in:
Gary Sharp
2013-10-10 19:13:16 +11:00
parent 172ce5524a
commit a099d68915
458 changed files with 40221 additions and 12130 deletions
@@ -1,23 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.Services.Authorization;
using Disco.Services.Web;
using System;
using System.Web.Mvc;
using Disco.BI.Extensions;
namespace Disco.Web.Areas.API.Controllers
{
public partial class BootstrapperController : dbAdminController
[DiscoAuthorize(Claims.Config.Enrolment.Configure)]
public partial class BootstrapperController : AuthorizedDatabaseController
{
public virtual ActionResult MacSshUsername(string MacSshUsername)
{
try
{
if (!string.IsNullOrWhiteSpace(MacSshUsername))
{
dbContext.DiscoConfiguration.Bootstrapper.MacSshUsername = MacSshUsername;
dbContext.SaveChanges();
Database.DiscoConfiguration.Bootstrapper.MacSshUsername = MacSshUsername;
Database.SaveChanges();
return Json("OK", JsonRequestBehavior.AllowGet);
}
else
@@ -36,8 +34,8 @@ namespace Disco.Web.Areas.API.Controllers
{
if (!string.IsNullOrWhiteSpace(MacSshPassword))
{
dbContext.DiscoConfiguration.Bootstrapper.MacSshPassword = MacSshPassword;
dbContext.SaveChanges();
Database.DiscoConfiguration.Bootstrapper.MacSshPassword = MacSshPassword;
Database.SaveChanges();
return Json("OK", JsonRequestBehavior.AllowGet);
}
else