Feature #26: User Flags

Flags can be associated with Users. Includes minor updates to Job Queues
and improved visibility of user information.
This commit is contained in:
Gary Sharp
2014-06-10 17:16:24 +10:00
parent b64ac3b16f
commit 4c3a68da30
104 changed files with 8112 additions and 1623 deletions
+20 -3
View File
@@ -84,7 +84,7 @@ namespace Disco.Web.Controllers
if (vm != null)
{
m.FriendlyTerm = string.Format("Device Model: {0}", vm.ToString());
m.Devices = Services.Searching.Search.SearchDeviceModel(Database, vm.Id, LimitCount: null);
m.Devices = Services.Searching.Search.SearchDeviceModel(Database, vm.Id);
break;
}
}
@@ -101,7 +101,7 @@ namespace Disco.Web.Controllers
if (dp != null)
{
m.FriendlyTerm = string.Format("Device Profile: {0}", dp.ToString());
m.Devices = Services.Searching.Search.SearchDeviceProfile(Database, dp.Id, LimitCount: null);
m.Devices = Services.Searching.Search.SearchDeviceProfile(Database, dp.Id);
break;
}
}
@@ -118,7 +118,7 @@ namespace Disco.Web.Controllers
if (db != null)
{
m.FriendlyTerm = string.Format("Device Batch: {0}", db.ToString());
m.Devices = Services.Searching.Search.SearchDeviceBatch(Database, db.Id, LimitCount: null);
m.Devices = Services.Searching.Search.SearchDeviceBatch(Database, db.Id);
break;
}
}
@@ -232,6 +232,23 @@ namespace Disco.Web.Controllers
return View(m);
}
}
case "userflag":
Authorization.RequireAll(Claims.User.Search, Claims.User.ShowFlagAssignments);
int flagId;
if (int.TryParse(term, out flagId))
{
var flag = Database.UserFlags.Find(flagId);
if (flag != null)
{
m.FriendlyTerm = string.Format("User Flag: {0}", flag.ToString());
m.Users = Services.Searching.Search.SearchUserFlag(Database, flag.Id);
break;
}
}
m.FriendlyTerm = string.Format("User Flag: {0}", term);
m.Success = false;
m.ErrorMessage = "Invalid User Flag Id";
break;
}
}