title: Logic wrong in custom loop on permissions authorization filter
body: <p>I'm getting false positives here. Basically, what I want to happen is only return an error if, for example, the user does not have permission to do <code>Create</code>—but currently it's returning an error even when they have that permission.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>User</th>
  <th>Permission</th>
  <th>Active</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>12</td>
  <td>Create</td>
  <td>True</td>
  </tr>
  <tr>
  <td>12</td>
  <td>Update</td>
  <td>False</td>
  </tr>
  <tr>
  <td>12</td>
  <td>Delete</td>
  <td>True</td>
  </tr>
  </tbody>
  </table>
  </div><h3>First Example</h3>
  <p>The following should return <code>true</code>. It does, but it's a false positive because <code>Read</code>, <code>Update</code>, and <code>Delete</code> are not present.</p>
  <pre><code>[HasPermission(&quot;Create&quot;); 
  </code></pre>
  <h3>Second Example</h3>
  <p>Should return <code>false</code>, but it is <em>also</em> returning that <code>Read</code> and <code>Delete</code> are not present when I am only asking for <code>Create</code> and <code>Update</code>:</p>
  <pre><code>[HasPermission(&quot;Create,Update&quot;); 
  </code></pre>
  <h3>Code</h3>
  <pre><code>string[] permissionValues = permission.Split(&quot;,&quot;);
  Dictionary&lt;string, bool&gt; dict = new Dictionary&lt;string, bool&gt;();
  
  foreach (var item in permissionValues)
  {
      var permissions = db.AppWarehouseUserPermmissions.Any(w =&gt; w.Name == item &amp;&amp; w.Controller == controllerName &amp;&amp; w.isAcitve == true);
      dict.Add(item, permissions);
  }
  foreach (var item in dict)
  {
      if (item.Key == &quot;Create&quot; || item.Key == &quot;Read&quot; || item.Key == &quot;Update&quot; || item.Key == &quot;Delete&quot; &amp;&amp; item.Value == true)
      {
          isAuthorised = true;
                 
      }
      if (item.Key == &quot;Create&quot; || item.Key == &quot;Read&quot; || item.Key==&quot;Update&quot; || item.Key==&quot;Delete&quot; &amp;&amp; item.Value==false)
      {                                        
              _customError.Add(new CutomError() { Message = $&quot;User has no {item.Key} permissions&quot;, ErrorCode = item.Key });
      }
  }
  return isAuthorised;
  </code></pre>