title: How can i do Authorization based on method parameters against current user claims
body: <p>Folks,</p>
  
  <p>My goal is to implement some security / checks around what an identity can do and on what resources. Essentially something as shown in the below pseudo code. 
  //Assuming entity.Name is the primary key &amp; is stored in the Claims Principal. </p>
  
  <p>My limitations are what comes with ClaimsPrincipalPermissions Attribute.</p>
  
  <pre><code>[CheckPermission(CurrentUser.Identity.Name == name)
  public BankAccount GetByUser(string name)
  {
  
  }
  
  [CheckPermission(CurrentUser.Identity.Name == entity.Name]
  public void Update(User entity)
  {
  
  }
  </code></pre>
  
  <p>I have refereed various articles around:
  the closest: <a href="https://stackoverflow.com/questions/21925245/how-to-pass-method-parameter-into-methods-attribute-value">How to pass method parameter into method&#39;s attribute value?</a>
  <a href="http://leastprivilege.com/2012/10/26/using-claims-based-authorization-in-mvc-and-web-api/" rel="nofollow noreferrer">http://leastprivilege.com/2012/10/26/using-claims-based-authorization-in-mvc-and-web-api/</a></p>
  
  <p>I am afraid, i feel that i am missing something obvious here. or is it not?</p>
  
  <p>What is the best practice to implement such a check??</p>