Skip to content

Instantly share code, notes, and snippets.

@svaustin66
Created November 27, 2019 02:00
Show Gist options
  • Save svaustin66/950d3acd363aba24ce5a668a33291932 to your computer and use it in GitHub Desktop.
Save svaustin66/950d3acd363aba24ce5a668a33291932 to your computer and use it in GitHub Desktop.
Only allow page access to Admins
{% if customer %}
{% if customer.tags contains 'admin' %}
<a name="pagecontent" id="pagecontent"></a>
<div class="sixteen columns page clearfix">
<h1>
{{ page.title }}
</h1>
<div class="feature_divider"></div>
<div>
{% include 'page-multi-column', content: page.content %}
</div>
</div>
{% else %}
<div class="container">
<div class="sixteen columns">
<h1>{{ product.title }}</h1>
<div class="feature_divider"></div>
<p>Access denied</p>
</div>
</div>
{% endif %}
{% else %}
<div class="container">
<div class="sixteen columns">
<h1>{{ product.title }}</h1>
<div class="feature_divider"></div>
<p>You must must be logged in to access this page. <a href="/account/login">Please login here</a>.</p>
</div>
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment