Answers.Body: <p><code>{% requirePermission %}</code> can only take on parameter. To make your code a little easier to manage, you might want to check for false in your conditional and exit. That way you wont have to worry about closing the if statement later in your template code. You could even stick the code below in a partial <code>_checkPermissions.html</code> template to include on your pages that require it.</p>
  
  <pre><code>{% if currentUser %}
      {% if not currentUser.can('perm1') and not currentUser.can('perm2')  %}
         {% exit 403 %}
      {% endif %}
  {% else  %}
      {% exit 403 %}
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-16T12:38:38.110Z
Answers.LastActivityDate: 2015-04-16T12:46:01.060Z
Answers.LastEditDate: 2015-04-16T12:46:01.060Z
Answers.UserDisplayName: Aaron Berkowitz
Answers.Body: <p>The <code>{% requirePermission 'perm1' %}</code> tag only supports a single permission. Behind the scenes it's <em>effectively</em> the same as:</p>
  
  <pre><code>{% if not currentUser.can('perm1') %}
      {% exit 403 %}
  {% endif %}
  </code></pre>
  
  <p>So I think either what you already have, or this:</p>
  
  <pre><code>{% if not currentUser.can('perm1') and not currentUser.can('perm2') %}
      {% exit 403 %}
  {% endif %}
  
  &lt;!-- Your page stuff --&gt;
  </code></pre>
  
  <p>Is probably your best bet at the moment. Checking that the user <em>doesn't</em> have both permissions, is the same as checking they <em>do</em> have one or the other.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-16T13:14:02.403Z
Answers.LastActivityDate: 2015-04-16T13:31:01.277Z
Answers.LastEditDate: 2015-04-16T13:31:01.277Z
Answers.UserDisplayName: Mike Pepper
Body: <p>I need to use requirePermission tag to check if one or another permission is active.</p>
  
  <p>I want to reproduce something like this:</p>
  
  <pre><code>{% if currentUser.can('perm1') or currentUser.can('perm2')  %}
     &lt;!-- My page stuff --&gt;
  {% else %}
     {% exit 403 %}
  {% endif %}
  </code></pre>
  
  <p>How can I make this possible <code>{% requirePermission "perm1_or_perm2" %}</code> ?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-16T13:11:50.113Z
Comments.Text: Why do you *need* to use `requirePermission` and can't just do it using `can`?
Comments.UserDisplayName: carlcs
Tags: <templating><permissions>
Title: {% requirePermission %} with OR condition
ThreadText: # {% requirePermission %} with OR condition
  
  (Asked by: username_0 on 2015-04-16)
  
  I need to use requirePermission tag to check if one or another permission is active.
  
  I want to reproduce something like this:
  
  ```
  {% if currentUser.can('perm1') or currentUser.can('perm2')  %}
     <!-- My page stuff -->
  {% else %}
     {% exit 403 %}
  {% endif %}
  
  ```
  
  How can I make this possible `{% requirePermission "perm1_or_perm2" %}` ?
  
  **Tags:** templating, permissions
  
  > **Comments:**
  > **username_1**: Why do you *need* to use `requirePermission` and can't just do it using `can`?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2015-04-16. Score: 4 | Accepted answer
  
  The `{% requirePermission 'perm1' %}` tag only supports a single permission. Behind the scenes it's *effectively* the same as:
  
  ```
  {% if not currentUser.can('perm1') %}
      {% exit 403 %}
  {% endif %}
  
  ```
  
  So I think either what you already have, or this:
  
  ```
  {% if not currentUser.can('perm1') and not currentUser.can('perm2') %}
      {% exit 403 %}
  {% endif %}
  
  <!-- Your page stuff -->
  
  ```
  
  Is probably your best bet at the moment. Checking that the user *doesn't* have both permissions, is the same as checking they *do* have one or the other.
  
  
  ---
  
  ### Answer by username_2 on 2015-04-16. Score: 3
  
  `{% requirePermission %}` can only take on parameter. To make your code a little easier to manage, you might want to check for false in your conditional and exit. That way you wont have to worry about closing the if statement later in your template code. You could even stick the code below in a partial `_checkPermissions.html` template to include on your pages that require it.
  
  ```
  {% if currentUser %}
      {% if not currentUser.can('perm1') and not currentUser.can('perm2')  %}
         {% exit 403 %}
      {% endif %}
  {% else  %}
      {% exit 403 %}
  {% endif %}
  
  ```
  
  
  ---
  
  