@model Disco.Web.Areas.Config.Models.DeviceFlag.ShowModel @using Disco.Services.Interop.ActiveDirectory; @using Disco.Services.Devices.DeviceFlags; @using Disco.Web.Areas.Config.Models.Shared; @{ Authorization.Require(Claims.Config.DeviceFlag.Show); ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Flags", MVC.Config.DeviceFlag.Index(null), Model.DeviceFlag.ToString()); var canConfig = Authorization.Has(Claims.Config.DeviceFlag.Configure); var canDelete = Authorization.Has(Claims.Config.DeviceFlag.Delete); var canBulkAssignment = Authorization.HasAll(Claims.Device.Actions.AddFlags, Claims.Device.Actions.RemoveFlags, Claims.Device.ShowFlagAssignments); var canShowDevices = Model.CurrentAssignmentCount > 0 && Authorization.HasAll(Claims.Device.Search, Claims.Device.ShowFlagAssignments); var canExportCurrent = Model.CurrentAssignmentCount > 0 && Authorization.Has(Claims.Config.DeviceFlag.Export); var canExportAll = Model.TotalAssignmentCount > 0 && Authorization.Has(Claims.Config.DeviceFlag.Export); var hideAdvanced = Model.Permission.IsDefault() && Model.DeviceFlag.DevicesLinkedGroup == null && Model.DeviceFlag.DeviceUsersLinkedGroup == null && Model.DeviceFlag.OnAssignmentExpression == null && Model.DeviceFlag.OnUnassignmentExpression == null; Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers"); }
| Id: | @Html.DisplayFor(model => model.DeviceFlag.Id) | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Name: | @if (canConfig) { @Html.EditorFor(model => model.DeviceFlag.Name) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader() } else { @Model.DeviceFlag.Name } | ||||||||||||||||||||||
| Description: |
@if (canConfig)
{@Html.EditorFor(model => model.DeviceFlag.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
}
else
{
@if (string.IsNullOrEmpty(Model.DeviceFlag.Description))
{
}
|
||||||||||||||||||||||
| Statistics: |
@Model.CurrentAssignmentCount device@(Model.CurrentAssignmentCount != 1 ? "s" : null) currently assigned
@Model.TotalAssignmentCount total device historical assignment@(Model.TotalAssignmentCount != 1 ? "s" : null)
|
||||||||||||||||||||||
| Icon: |
@if (canConfig)
{
Update
}
@using (Html.BeginForm(MVC.API.DeviceFlag.UpdateIconAndColour(id: Model.DeviceFlag.Id, redirect: true)))
{
@Html.AntiForgeryToken()
}
@foreach (var colour in Model.ThemeColours)
{
}
@foreach (var icon in Model.Icons)
{
}
|
||||||||||||||||||||||
|
Assignment Permission Override: |
@if (!Model.Permission.IsDefault())
{
var permission = Model.Permission;
@if (permission.Inherit)
{
Inheriting from Authorization Roles
}
else
{
Authorization Roles are Ignored
}
if (!permission.HasSubjects())
{
There are no users/groups associated with this permission override
}
else
{
if (permission.IsSimple())
{
All users/groups/roles can view, assign, edit assignments, and remove assignments for this flag.
@using (Html.BeginForm(MVC.API.DeviceFlag.Permission(Model.DeviceFlag.Id)))
{
@Html.AntiForgeryToken()
}
Flag actions are normally authorized globally by @if (Authorization.Has(Claims.DiscoAdminAccount)) { Authorization Roles. } else { Authorization Roles. } Overriding individual flag permissions allows for targeted authorization. |
||||||||||||||||||||||
|
On Assignment Expression: |
@if (canConfig)
{
@Html.EditorFor(model => model.DeviceFlag.OnAssignmentExpression)
@AjaxHelpers.AjaxRemove()
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
}
else
{
if (string.IsNullOrWhiteSpace(Model.DeviceFlag.OnAssignmentExpression))
{
<None Specified>
}
else
{
@Model.DeviceFlag.OnAssignmentExpression
}
}
This expression will be evaluated whenever the flag is assigned to a device. The output of the expression will be shown with the flag assignment. |
||||||||||||||||||||||
|
On Unassignment Expression: |
@if (canConfig)
{
@Html.EditorFor(model => model.DeviceFlag.OnUnassignmentExpression)
@AjaxHelpers.AjaxRemove()
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
}
else
{
if (string.IsNullOrWhiteSpace(Model.DeviceFlag.OnUnassignmentExpression))
{
<None Specified>
}
else
{
@Model.DeviceFlag.OnUnassignmentExpression
}
}
This expression will be evaluated whenever the flag is removed from a device. The output of the expression will be shown with the flag assignment. |
||||||||||||||||||||||
| Linked Groups: |
@Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
{
CanConfigure = canConfig,
CategoryDescription = DeviceFlagDevicesManagedGroup.GetCategoryDescription(Model.DeviceFlag),
Description = DeviceFlagDevicesManagedGroup.GetDescription(Model.DeviceFlag),
ManagedGroup = Model.DevicesLinkedGroup,
IncludeFilterBeginDate = true,
UpdateUrl = Url.Action(MVC.API.DeviceFlag.UpdateDevicesLinkedGroup(Model.DeviceFlag.Id, redirect: true))
})
@Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
{
CanConfigure = canConfig,
CategoryDescription = DeviceFlagDeviceAssignedUsersManagedGroup.GetCategoryDescription(Model.DeviceFlag),
Description = DeviceFlagDeviceAssignedUsersManagedGroup.GetDescription(Model.DeviceFlag),
ManagedGroup = Model.AssignedUserLinkedGroup,
IncludeFilterBeginDate = true,
UpdateUrl = Url.Action(MVC.API.DeviceFlag.UpdateAssignedUserLinkedGroup(Model.DeviceFlag.Id, redirect: true))
})
@if (canConfig)
{
@Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared)
}
|
||||||||||||||||||||||
Select the mode used to assign devices:
Specified devices will have this flag added. Devices who already have this flag will be skipped.
Specified devices will have this flag added. Specified devices which already have this flag will be skipped. Devices who already have this flag but are not specified will have the flag removed.
<new line>, commas (,) or semicolons (;).
This item will be permanently deleted and cannot be recovered.
@if (Model.CurrentAssignmentCount > 0)
{
@Model.CurrentAssignmentCount device@(Model.CurrentAssignmentCount != 1 ? "s are" : " is") currently assigned
}
Are you sure?