Skip to content

Commit

Permalink
CON-2486-Access Denied (#143)
Browse files Browse the repository at this point in the history
* CON-2486-Access Denied

* CON-2486-'Access denied' message displayed to Viewer user

* CON-2486- Update 'Access denied' message displayed to Viewer user

* CON-2486-Access Denied Link

Co-authored-by: Raj <reachash1@hotmail.com>
  • Loading branch information
VasanthaKasirajan3008 and reachash authored Oct 26, 2020
1 parent 78329c7 commit bf2d107
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ public class ErrorController : Controller
{
[Route("error")]
public IActionResult Error(int? statusCode)
{
{
ViewBag.HideNav = true;

switch (statusCode)
{
case 400:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,10 @@ public static string EmployerHome(this ILinkGenerator linkGenerator, string acco
{
return linkGenerator.UsersLink($"accounts/{accountHashedId}/teams");
}

public static string EmployerAccountsHome(this ILinkGenerator linkGenerator)
{
return linkGenerator.AccountsLink();
}
}
}
15 changes: 13 additions & 2 deletions src/SFA.DAS.EmployerCommitmentsV2.Web/Views/Error/403.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
@{
@inject ILinkGenerator LinkGenerator
@using SFA.DAS.EmployerCommitmentsV2.Web.Extensions

@{
ViewData["Title"] = "Access denied";
ViewBag.GaData.Vpv = "/error/403";
}

<h1 class="govuk-heading-xl">Access denied</h1>
<p class="govuk-body">Your account does not have sufficient privileges.</p>
<p class="govuk-body">Your account does not have sufficient privileges.</p>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<p>If you are experiencing difficulty accessing the area of the site you need, first contact an/the account owner to ensure you have the correct role assigned to your account.</p>
</div>
</div>

<a class="govuk-button" href="@LinkGenerator.EmployerAccountsHome()">Go back to the service home page</a>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
@using SFA.DAS.Employer.Shared.UI.Models
@using SFA.DAS.EmployerCommitmentsV2.Web.Extensions

<!DOCTYPE html>
<html lang="en" class="govuk-template ">

@{

var accountHashedId = (string)ViewContext.RouteData.Values["accountHashedId"];
ViewBag.HideHeaderBorder = true;
var footerModel = new FooterModel { AccountId = accountHashedId, UsePrivacyV2 = true };
Expand Down Expand Up @@ -58,8 +59,11 @@

<partial name="_CookieConsentBanner" />

<partial name="_Header" />
<partial name="_Menu" model="@accountHashedId" />
<partial name="_Header" />
@if (ViewBag.HideNav == null || !ViewBag.HideNav)
{
<partial name="_Menu" model="@accountHashedId" />
}
<partial name="_ZenDeskWidget" />
<div class="govuk-width-container">
@if (IsSectionDefined("Back"))
Expand All @@ -72,7 +76,7 @@
</main>
</div>

<partial name="_Footer" model="@footerModel"/>
<partial name="_Footer" model="@footerModel" />
<partial name="_GoogleAnalyticsInfo" />


Expand Down

0 comments on commit bf2d107

Please sign in to comment.