Add permissions for downloading LeafInput
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
@{
|
||||
ViewBag.Title = "Permission Denied";
|
||||
}
|
||||
|
||||
<h1>
|
||||
@ViewBag.Title
|
||||
</h1>
|
||||
|
||||
<p>Permission denied for requested resource. If you believe this to be in error please contact administrator, referencing the following url:</p>
|
||||
<code>@Html.Raw(Request.Url)</code>
|
||||
@@ -1,8 +1,10 @@
|
||||
@using LeafWeb.Core.Entities
|
||||
@using LeafWeb.WebCms.Utility
|
||||
|
||||
@model LeafInput
|
||||
@{
|
||||
var admin = ViewData.ContainsKey("admin");
|
||||
var username = HttpContext.Current.User.Identity.Name;
|
||||
}
|
||||
|
||||
<div class="btn-group text-nowrap" role="group">
|
||||
@@ -15,33 +17,38 @@
|
||||
@if (admin)
|
||||
{
|
||||
@Details_AdminLink(Model)
|
||||
@ChartLink(Model)
|
||||
if (Model.IsPending)
|
||||
{
|
||||
<div class="dropdown-divider"></div>
|
||||
<h6 class="dropdown-header">Priority</h6>
|
||||
<button class="dropdown-item @DisableItem(Model.PendingPriority == Priority.High)">@PriorityForm(Model, Priority.High)</button>
|
||||
<button class="dropdown-item @DisableItem(Model.PendingPriority == Priority.Normal)">@PriorityForm(Model, Priority.Normal)</button>
|
||||
<button class="dropdown-item @DisableItem(Model.PendingPriority == Priority.Low)">@PriorityForm(Model, Priority.Low)</button>
|
||||
}
|
||||
if (Model.IsCancellable)
|
||||
{
|
||||
<div class="dropdown-divider"></div>
|
||||
@CancelLink(Model)
|
||||
}
|
||||
<div class="dropdown-divider"></div>
|
||||
<h6 class="dropdown-header">Download</h6>
|
||||
@DownloadInput(Model)
|
||||
@DownloadOutputToUser(Model)
|
||||
<div class="dropdown-divider"></div>
|
||||
@DeleteLink(Model)
|
||||
}
|
||||
else
|
||||
{
|
||||
@Details_ResultsLink(Model)
|
||||
}
|
||||
@ChartLink(Model)
|
||||
@if (admin && Model.IsPending)
|
||||
{
|
||||
<div class="dropdown-divider"></div>
|
||||
<h6 class="dropdown-header">Priority</h6>
|
||||
<button class="dropdown-item @DisableItem(Model.PendingPriority == Priority.High)">@PriorityForm(Model, Priority.High)</button>
|
||||
<button class="dropdown-item @DisableItem(Model.PendingPriority == Priority.Normal)">@PriorityForm(Model, Priority.Normal)</button>
|
||||
<button class="dropdown-item @DisableItem(Model.PendingPriority == Priority.Low)">@PriorityForm(Model, Priority.Low)</button>
|
||||
}
|
||||
@if (admin && Model.IsCancellable)
|
||||
{
|
||||
<div class="dropdown-divider"></div>
|
||||
@CancelLink(Model)
|
||||
}
|
||||
<div class="dropdown-divider"></div>
|
||||
<h6 class="dropdown-header">Download</h6>
|
||||
@DownloadInput(Model)
|
||||
@DownloadOutputToUser(Model)
|
||||
@if (admin)
|
||||
{
|
||||
<div class="dropdown-divider"></div>
|
||||
@DeleteLink(Model)
|
||||
@ChartLink(Model)
|
||||
if (string.Equals(Model.Email, username, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
<div class="dropdown-divider"></div>
|
||||
<h6 class="dropdown-header">Download</h6>
|
||||
@DownloadInput(Model)
|
||||
@DownloadOutputToUser(Model)
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,7 +88,7 @@
|
||||
@helper DownloadOutputToUser(dynamic item)
|
||||
{
|
||||
<a href="@Url.Action("OutputToUser", "Download", new {id = item.Id})" class="dropdown-item @DisableItem(!item.HasOutputFiles)">
|
||||
<span class="fa fa-download"></span> ToUser
|
||||
<span class="fa fa-download"></span> Output
|
||||
</a>
|
||||
}
|
||||
@helper DeleteLink(LeafInput item)
|
||||
|
||||
Reference in New Issue
Block a user