Body: <p>I am currently trying to create a participant on a Drupal form submit, when i do this I get an error saying Authorization failed. I've tried managing the ACLs in Civi with no success, I've also changed the drupal roles to allow anyone to add a participant. I've also tried to set the permissions manually using the code below</p>
  
  <pre><code>hook_civicrm_alterAPIPermissions($entity, $action, &amp;$params, &amp;$permissions) {
    $permissions['Participant'] = array(
      'get' =&gt; array(
        'access CiviCRM',
        'access CiviEvent',
        'edit all events',
      ),
    );
  }
  </code></pre>
  
  <p>but this didn't work either </p>
  
  <p>If anyone has any suggestions it would be a great help, I can supply more information if needed </p>
  
  <p>thanks in advanced!</p>
  
  <p>EDIT:
  I found that I needed to allow users access to the backend of civi to get this to work, this is not ideal so I am still looking for workarounds</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-08T12:03:51.373Z
Comments.Text: `I am currently trying to create a participant on a Drupal form submit` - can you share the code of this part so we can see where the error is being generated?
Comments.UserDisplayName: jitendra - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-19T10:14:42.463Z
Comments.Text: Do you have solution im have same problem with permission and api4 ?
Comments.UserDisplayName: gassama.makoa
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-20T11:05:26.367Z
Comments.Text: So my current workaround for this was to check the permissions to access all civicrm api which gives the user access to the civicrm backend which isn't ideal, however I think you can do the same stuff with api 3 without having to give the user access to civi
Comments.UserDisplayName: someone
Tags: <civievent><api><participants><authentication>
Title: API4 authorization failure when creating a participant
ThreadText: # API4 authorization failure when creating a participant
  
  (Asked by: username_0 on 2019-11-07)
  
  I am currently trying to create a participant on a Drupal form submit, when i do this I get an error saying Authorization failed. I've tried managing the ACLs in Civi with no success, I've also changed the drupal roles to allow anyone to add a participant. I've also tried to set the permissions manually using the code below
  
  ```
  hook_civicrm_alterAPIPermissions($entity, $action, &$params, &$permissions) {
    $permissions['Participant'] = array(
      'get' => array(
        'access CiviCRM',
        'access CiviEvent',
        'edit all events',
      ),
    );
  }
  
  ```
  
  but this didn't work either
  
  If anyone has any suggestions it would be a great help, I can supply more information if needed
  
  thanks in advanced!
  
  EDIT:
  I found that I needed to allow users access to the backend of civi to get this to work, this is not ideal so I am still looking for workarounds
  
  **Tags:** civievent, api, participants, authentication
  
  > **Comments:**
  > **username_1**: `I am currently trying to create a participant on a Drupal form submit` - can you share the code of this part so we can see where the error is being generated?  
  > **username_2**: Do you have solution im have same problem with permission and api4 ?  
  > **username_0**: So my current workaround for this was to check the permissions to access all civicrm api which gives the user access to the civicrm backend which isn't ideal, however I think you can do the same stuff with api 3 without having to give the user access to civi  
  
  ---
  
  ## 0 answers
  
  