diff --git a/source/Extant/Extant.Web/Infrastructure/FileUploadModelBinder.cs b/source/Extant/Extant.Web/Infrastructure/FileUploadModelBinder.cs index 13dfc18..709e5eb 100644 --- a/source/Extant/Extant.Web/Infrastructure/FileUploadModelBinder.cs +++ b/source/Extant/Extant.Web/Infrastructure/FileUploadModelBinder.cs @@ -3,8 +3,9 @@ // Copyright (c) North West e-Health 2011. All rights reserved. // //----------------------------------------------------------------------- -using System; +using System.Web; using System.Web.Mvc; +using Extant.Data; using Extant.Data.Entities; namespace Extant.Web.Infrastructure @@ -21,6 +22,7 @@ public object BindModel(ControllerContext controllerContext, ModelBindingContext theFile.InputStream.Read(fileUpload.FileData, 0, theFile.ContentLength); fileUpload.FileName = theFile.FileName; fileUpload.MimeType = theFile.ContentType; + fileUpload.IsApproved = HttpContext.Current.User.IsInRole(Constants.AdministratorRole); return fileUpload; } return null; diff --git a/source/Extant/Extant.Web/Models/FileUploadModel.cs b/source/Extant/Extant.Web/Models/FileUploadModel.cs index 71d885f..d098a6f 100644 --- a/source/Extant/Extant.Web/Models/FileUploadModel.cs +++ b/source/Extant/Extant.Web/Models/FileUploadModel.cs @@ -14,5 +14,7 @@ public class FileUploadModel public string FileSize { get; set; } public string MimeType { get; set; } + + public bool IsApproved { get; set; } } } \ No newline at end of file diff --git a/source/Extant/Extant.Web/Views/Study/Index.aspx b/source/Extant/Extant.Web/Views/Study/Index.aspx index 2675835..694900b 100644 --- a/source/Extant/Extant.Web/Views/Study/Index.aspx +++ b/source/Extant/Extant.Web/Views/Study/Index.aspx @@ -129,14 +129,14 @@
Files

Patient Information Leaflet: -<% if (null != Model.PatientInformationLeaflet){ %> +<% if (null != Model.PatientInformationLeaflet && Model.PatientInformationLeaflet.IsApproved){ %> Download (<%:Model.PatientInformationLeaflet.FileSize %>) <% } else { %> N/A <% } %>

Consent Form: - <% if (null != Model.ConsentForm){ %> + <% if (null != Model.ConsentForm && Model.ConsentForm.IsApproved){ %> Download (<%:Model.ConsentForm.FileSize %>) <% } else {%> N/A @@ -144,7 +144,7 @@

Has Data Access Policy: <%:Model.HasDataAccessPolicy %>

Data Access Policy: - <% if (null != Model.DataAccessPolicy){ %> + <% if (null != Model.DataAccessPolicy && Model.DataAccessPolicy.IsApproved){ %> Download (<%:Model.DataAccessPolicy.FileSize%>) <% } else {%> N/A @@ -156,11 +156,13 @@ %>

Additional Files

<% - foreach (var file in Model.AdditionalDocuments) - { + foreach (var file in Model.AdditionalDocuments) + { + if (file.File.IsApproved) { %>

<%:file.Description %> (<%:file.DocumentType %>) - Download (<%:file.File.FileSize%>)

<% + } } } %>