Permissions & Authorization for Users #24
Initial Release; Includes Database and MVC refactoring
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.18033
|
||||
// Runtime Version:4.0.30319.18051
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -28,12 +28,14 @@ namespace Disco.Web.Views.Job
|
||||
using System.Web.WebPages;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/Show.cshtml")]
|
||||
public partial class Show : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
|
||||
public partial class Show : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ShowModel>
|
||||
{
|
||||
public Show()
|
||||
{
|
||||
@@ -44,9 +46,16 @@ namespace Disco.Web.Views.Job
|
||||
#line 2 "..\..\Views\Job\Show.cshtml"
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id.ToString()));
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
|
||||
if (Authorization.Has(Claims.Job.Actions.AddAttachments))
|
||||
{
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Silverlight");
|
||||
}
|
||||
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/jQueryUI-TimePicker");
|
||||
|
||||
Authorization.Require(Claims.Job.Show);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -61,35 +70,35 @@ WriteLiteral(" id=\"Job_Show_Status\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 9 "..\..\Views\Job\Show.cshtml"
|
||||
#line 16 "..\..\Views\Job\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 9 "..\..\Views\Job\Show.cshtml"
|
||||
#line 16 "..\..\Views\Job\Show.cshtml"
|
||||
var jobStatusInfo = Model.Job.Status();
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <span");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 420), Tuple.Create("\"", 464)
|
||||
, Tuple.Create(Tuple.Create("", 428), Tuple.Create("icon", 428), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 432), Tuple.Create("JobStatus", 433), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 552), Tuple.Create("\"", 596)
|
||||
, Tuple.Create(Tuple.Create("", 560), Tuple.Create("icon", 560), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 564), Tuple.Create("JobStatus", 565), true)
|
||||
|
||||
#line 10 "..\..\Views\Job\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 442), Tuple.Create<System.Object, System.Int32>(jobStatusInfo.Item1
|
||||
#line 17 "..\..\Views\Job\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 574), Tuple.Create<System.Object, System.Int32>(jobStatusInfo.Item1
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 442), false)
|
||||
, 574), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></span>");
|
||||
|
||||
|
||||
#line 10 "..\..\Views\Job\Show.cshtml"
|
||||
#line 17 "..\..\Views\Job\Show.cshtml"
|
||||
Write(jobStatusInfo.Item2);
|
||||
|
||||
|
||||
@@ -105,7 +114,7 @@ WriteLiteral(">\r\n $(function () {\r\n $(\'#Job_Show_
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 17 "..\..\Views\Job\Show.cshtml"
|
||||
#line 24 "..\..\Views\Job\Show.cshtml"
|
||||
Write(Html.Partial(MVC.Job.Views.JobParts._Subject, Model));
|
||||
|
||||
|
||||
@@ -115,36 +124,26 @@ WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
var $tabs = $('#jobDetailTabs');
|
||||
$tabs.tabs({
|
||||
activate: function (event, ui) {
|
||||
window.setTimeout(function () {
|
||||
var $window = $(window);
|
||||
var tabHeight = $tabs.height();
|
||||
var tabOffset = $tabs.offset();
|
||||
var windowScrollTop = $window.scrollTop();
|
||||
var windowHeight = $window.height();
|
||||
|
||||
var tabTopNotShown = windowScrollTop - tabOffset.top;
|
||||
if (tabTopNotShown > 0) {
|
||||
$('html').animate({ scrollTop: tabOffset.top }, 125);
|
||||
} else {
|
||||
var tabBottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.top)) * -1;
|
||||
if (tabBottomNotShown > 0) {
|
||||
if (tabHeight > windowHeight)
|
||||
$('html').animate({ scrollTop: tabOffset.top }, 125);
|
||||
else
|
||||
$('html').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);
|
||||
}
|
||||
}
|
||||
}, 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<div");
|
||||
WriteLiteral(">\r\n $(function () {\r\n var $tabs = $(\'#jobDetailTabs\');\r\n " +
|
||||
" if ($tabs.children().length > 1) {\r\n $tabs.tabs({\r\n " +
|
||||
" activate: function (event, ui) {\r\n window.setT" +
|
||||
"imeout(function () {\r\n var $window = $(window);\r\n " +
|
||||
" var tabHeight = $tabs.height();\r\n " +
|
||||
" var tabOffset = $tabs.offset();\r\n var windowScro" +
|
||||
"llTop = $window.scrollTop();\r\n var windowHeight = $wi" +
|
||||
"ndow.height();\r\n\r\n var tabTopNotShown = windowScrollT" +
|
||||
"op - tabOffset.top;\r\n if (tabTopNotShown > 0) {\r\n " +
|
||||
" $(\'html\').animate({ scrollTop: tabOffset.top }, 125)" +
|
||||
";\r\n } else {\r\n var tab" +
|
||||
"BottomNotShown = ((windowScrollTop + windowHeight) - (tabHeight + tabOffset.top)" +
|
||||
") * -1;\r\n if (tabBottomNotShown > 0) {\r\n " +
|
||||
" if (tabHeight > windowHeight)\r\n " +
|
||||
" $(\'html\').animate({ scrollTop: tabOffset.top }, 125);\r\n " +
|
||||
" else\r\n $(\'ht" +
|
||||
"ml\').animate({ scrollTop: windowScrollTop + tabBottomNotShown }, 125);\r\n " +
|
||||
" }\r\n }\r\n " +
|
||||
" }, 1);\r\n }\r\n });\r\n } else {\r\n " +
|
||||
" $tabs.hide();\r\n }\r\n });\r\n </script>\r\n <div");
|
||||
|
||||
WriteLiteral(" id=\"jobDetailTabs\"");
|
||||
|
||||
@@ -152,11 +151,82 @@ WriteLiteral(">\r\n <ul");
|
||||
|
||||
WriteLiteral(" id=\"jobDetailTabItems\"");
|
||||
|
||||
WriteLiteral(">\r\n <li><a");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 60 "..\..\Views\Job\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 60 "..\..\Views\Job\Show.cshtml"
|
||||
if (Authorization.HasAll(Claims.Job.ShowLogs, Claims.Job.ShowAttachments))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li><a");
|
||||
|
||||
WriteLiteral(" href=\"#jobDetailTab-Resources\"");
|
||||
|
||||
WriteLiteral(">Log and Attachments</a></li>\r\n </ul>\r\n <div");
|
||||
WriteLiteral(">Log and Attachments</a></li>\r\n");
|
||||
|
||||
|
||||
#line 63 "..\..\Views\Job\Show.cshtml"
|
||||
}
|
||||
else if (Authorization.Has(Claims.Job.ShowLogs))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li><a");
|
||||
|
||||
WriteLiteral(" href=\"#jobDetailTab-Resources\"");
|
||||
|
||||
WriteLiteral(">Log</a></li>\r\n");
|
||||
|
||||
|
||||
#line 67 "..\..\Views\Job\Show.cshtml"
|
||||
}
|
||||
else if (Authorization.Has(Claims.Job.ShowLogs))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li><a");
|
||||
|
||||
WriteLiteral(" href=\"#jobDetailTab-Resources\"");
|
||||
|
||||
WriteLiteral(">Attachments</a></li>\r\n");
|
||||
|
||||
|
||||
#line 71 "..\..\Views\Job\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </ul>\r\n");
|
||||
|
||||
|
||||
#line 73 "..\..\Views\Job\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 73 "..\..\Views\Job\Show.cshtml"
|
||||
if (Authorization.HasAny(Claims.Job.ShowLogs, Claims.Job.ShowAttachments))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"jobDetailTab-Resources\"");
|
||||
|
||||
@@ -164,27 +234,34 @@ WriteLiteral(" class=\"jobPart\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 52 "..\..\Views\Job\Show.cshtml"
|
||||
Write(Html.Partial(MVC.Job.Views.JobParts.Resources, Model));
|
||||
#line 76 "..\..\Views\Job\Show.cshtml"
|
||||
Write(Html.Partial(MVC.Job.Views.JobParts.Resources, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 78 "..\..\Views\Job\Show.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 54 "..\..\Views\Job\Show.cshtml"
|
||||
#line 79 "..\..\Views\Job\Show.cshtml"
|
||||
Write(Html.Partial(MVC.Job.Views.JobParts.JobMetaAdditions, Model));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n</div>");
|
||||
WriteLiteral("\r\n </div>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user