Bug Fix: Minor permission enforcements

Also some UI tweaks.
This commit is contained in:
Gary Sharp
2014-02-13 15:27:04 +11:00
parent a6a65c54c7
commit 2ac3a9bdd3
9 changed files with 445 additions and 223 deletions
@@ -15,11 +15,11 @@
<tbody>
<tr>
<th>LAN MAC Address</th>
<td>@(Model.Device.DeviceDetails.LanMacAddress() ?? "Unknown")</td>
<td class="code">@(Model.Device.DeviceDetails.LanMacAddress() ?? "Unknown")</td>
</tr>
<tr>
<th>WLAN MAC Address</th>
<td>@(Model.Device.DeviceDetails.WLanMacAddress() ?? "Unknown")</td>
<td class="code">@(Model.Device.DeviceDetails.WLanMacAddress() ?? "Unknown")</td>
</tr>
<tr>
<th>AC Adapter</th>
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.Device.DeviceParts
using Disco;
using Disco.BI.Extensions;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
@@ -73,21 +74,29 @@ WriteLiteral(">\r\n <table");
WriteLiteral(" class=\"tableData\"");
WriteLiteral(">\r\n <tbody>\r\n <tr>\r\n <th>LAN MAC Add" +
"ress</th>\r\n <td>");
"ress</th>\r\n <td");
WriteLiteral(" class=\"code\"");
WriteLiteral(">");
#line 18 "..\..\Views\Device\DeviceParts\_Details.cshtml"
Write(Model.Device.DeviceDetails.LanMacAddress() ?? "Unknown");
Write(Model.Device.DeviceDetails.LanMacAddress() ?? "Unknown");
#line default
#line hidden
WriteLiteral("</td>\r\n </tr>\r\n <tr>\r\n <th>WLAN " +
"MAC Address</th>\r\n <td>");
"MAC Address</th>\r\n <td");
WriteLiteral(" class=\"code\"");
WriteLiteral(">");
#line 22 "..\..\Views\Device\DeviceParts\_Details.cshtml"
Write(Model.Device.DeviceDetails.WLanMacAddress() ?? "Unknown");
Write(Model.Device.DeviceDetails.WLanMacAddress() ?? "Unknown");
#line default
@@ -235,11 +235,11 @@
</td>
</tr>
</table>
<div id="dialogUpload" title="Upload Attachment">
<div id="dialogUpload" class="dialog" title="Upload Attachment">
<div id="silverlightHostUploadAttachment">
</div>
</div>
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
<div id="dialogRemoveAttachment" class="dialog" title="Remove this Attachment?">
<p>
<i class="fa fa-exclamation-triangle fa-lg"></i>&nbsp;Are you sure?
</p>
@@ -706,6 +706,8 @@ WriteLiteral(@"
WriteLiteral(" id=\"dialogUpload\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Upload Attachment\"");
WriteLiteral(">\r\n <div");
@@ -716,6 +718,8 @@ WriteLiteral(">\r\n </div>\r\n </div>\r\n <div");
WriteLiteral(" id=\"dialogRemoveAttachment\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Remove this Attachment?\"");
WriteLiteral(">\r\n <p>\r\n <i");
@@ -32,7 +32,7 @@
}
else
{
<span class="small discreet">@Model.Device.AssetNumber</span>
<span class="small discreet">@(Model.Device.AssetNumber ?? "Unknown")</span>
}
</td>
</tr>
@@ -45,7 +45,7 @@
}
else
{
<span class="small discreet">@Model.Device.Location</span>
<span class="small discreet">@(Model.Device.Location ?? "Unknown")</span>
}
</td>
</tr>
@@ -175,7 +175,16 @@
@if (assignedUser != null)
{
<div id="Device_Show_User">
<div id="Device_Show_User_DisplayName" title="Display Name">@Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.Id))</div>
<div id="Device_Show_User_DisplayName" title="Display Name">
@if (Authorization.Has(Claims.User.Show))
{
@Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.Id))
}
else
{
@assignedUser.DisplayName
}
</div>
<div id="Device_Show_User_Id" title="Id">@assignedUser.Id</div>
@if (Authorization.Has(Claims.User.ShowDetails))
{
@@ -222,7 +231,14 @@
<td id="Device_Show_Policies" rowspan="2">
<div>
<div id="Device_Show_Policies_Profile">
<h2 title="Device Profile">@Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId))</h2>
<h2 title="Device Profile">@if (Authorization.Has(Claims.Config.DeviceProfile.Show))
{
@Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId))
}
else
{
@Model.Device.DeviceProfile.Name
}</h2>
<table class="none verticalHeadings">
<tr>
<td><span title="Distribution Type">Distribution:</span>
@@ -330,7 +346,14 @@
<div id="Device_Show_Policies_Batch" class="status">
@if (Model.Device.DeviceBatchId.HasValue)
{
<h2 title="Device Batch">@Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value))</h2>
<h2 title="Device Batch">@if (Authorization.Has(Claims.Config.DeviceBatch.Show))
{
@Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value))
}
else
{
@Model.Device.DeviceBatch.Name
}</h2>
<table class="none verticalHeadings">
<tr>
<td><span title="Purchased Date">Purchased:</span>
@@ -442,7 +465,14 @@
<td id="Device_Show_Aspects" rowspan="2">
<div>
<div id="Device_Show_Aspects_Model" class="clearfix">
<h2 id="Device_Show_Aspects_Model_Description" title="Model Description">@Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId))</h2>
<h2 id="Device_Show_Aspects_Model_Description" title="Model Description">@if (Authorization.Has(Claims.Config.DeviceModel.Show))
{
@Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId))
}
else
{
@Model.Device.DeviceModel.ToString()
}</h2>
<img id="Device_Show_Aspects_Model_Image" alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))" />
</div>
</div>
File diff suppressed because it is too large Load Diff