Skip to content

Commit

Permalink
Grand.Web - update HeaderLinks.cshtml
Browse files Browse the repository at this point in the history
  • Loading branch information
support committed Nov 1, 2023
1 parent 0a68fb4 commit 3983ddb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Web/Grand.Web/Views/Shared/Partials/HeaderLinks.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
var isAuthenticated = await groupService.IsRegistered(workContext.CurrentCustomer);
var isCustomerImpersonated = workContext.OriginalCustomerIfImpersonated != null;
var isAdminAccess = await permissionService.Authorize(StandardPermission.AccessAdminPanel);
var isVendor = workContext.CurrentVendor != null;
}

@await Component.InvokeAsync("Widget", new { widgetZone = "header_links_before" })
Expand All @@ -23,13 +24,20 @@
}
@if (isAuthenticated)
{
@if (isAdminAccess)
@if (isAdminAccess && !isVendor)
{
<a class="btn btn-outline-secondary w-100 mb-2" href="@Url.Content("~/Admin")">
<b-icon icon="gear"></b-icon>
<span class="text text-uppercase ml-3">@Loc["admin"]</span>
</a>
}
@if (isVendor)
{
<a class="btn btn-outline-secondary w-100 mb-2" href="@Url.Content("~/Vendor")">
<b-icon icon="gear"></b-icon>
<span class="text text-uppercase ml-3">@Loc["vendor.portal"]</span>
</a>
}
@if (!string.IsNullOrEmpty(pagebuilder.EditPageUrl))
{
<a target="_blank" class="btn btn-outline-secondary w-100 mb-2" href="@pagebuilder.EditPageUrl">
Expand Down

0 comments on commit 3983ddb

Please sign in to comment.