Answers.Body: <p>This doesn't have a completely straightforward answer because sometimes one entity will create another entity with its own set of permissions.  Additionally, permissions also get blended with ACLs and custom permission hooks.  Finally, the permissions typically happen at the BAO and not API layer.</p>
  
  <p>That said - the best single resource is <a href="https://github.com/mlutfy/civicrm-core/blob/1aef7f9388df003de9537ed7fdca28b4a22361d6/CRM/Core/Permission.php#L895" rel="nofollow noreferrer">CRM_Core_Permission::getEntityActionPermissions()</a>. See <a href="https://issues.civicrm.org/jira/browse/CRM-20581" rel="nofollow noreferrer">CRM-20581</a> for a real-life recent example of how creating an event failed because accessing the StateProvince entity went from being a permission-skipping call to a permission-respecting call.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-17T18:23:38.813Z
Answers.LastActivityDate: 2017-07-17T18:23:38.813Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>If I pick a random <strong>entity</strong> and <strong>action</strong>, what steps can I take (manually if necessary) to see which specific permissions are necessary for CiviCRM to execute an API call with <code>check_permissions=1</code>?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-17T16:06:32.033Z
Comments.Text: Good question! It would be nice if there was an API action for this.
Comments.UserDisplayName: jackrabbithanna
Tags: <api><developer>
Title: How do I see which permissions are necessary to execute a given API call?
ThreadText: # How do I see which permissions are necessary to execute a given API call?
  
  (Asked by: username_0 on 2017-07-17)
  
  If I pick a random **entity** and **action**, what steps can I take (manually if necessary) to see which specific permissions are necessary for CiviCRM to execute an API call with `check_permissions=1`?
  
  **Tags:** api, developer
  
  > **Comments:**
  > **username_1**: Good question! It would be nice if there was an API action for this.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-07-17. Score: 1
  
  This doesn't have a completely straightforward answer because sometimes one entity will create another entity with its own set of permissions. Additionally, permissions also get blended with ACLs and custom permission hooks. Finally, the permissions typically happen at the BAO and not API layer.
  
  That said - the best single resource is [CRM\_Core\_Permission::getEntityActionPermissions()](https://github.com/mlutfy/civicrm-core/blob/1aef7f9388df003de9537ed7fdca28b4a22361d6/CRM/Core/Permission.php#L895). See [CRM-20581](https://issues.civicrm.org/jira/browse/CRM-20581) for a real-life recent example of how creating an event failed because accessing the StateProvince entity went from being a permission-skipping call to a permission-respecting call.
  
  
  ---
  
  