Answers.Body: <p>You'll have to write a custom plugin and point your frontend form to save to its own controller action that allows anonymous access.</p>
  
  <p>That action can either 1) duplicate Commerce's <code>saveProduct</code> method, which can be brittle if it changes or 2) start a session from a generic user account that has the proper permissions and <a href="http://www.yiiframework.com/doc/api/1.1/CController#forward-detail" rel="nofollow noreferrer">forward</a> the request onto Commerce's <code>saveProduct</code> method.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-20T17:35:51.720Z
Answers.LastActivityDate: 2016-12-20T17:35:51.720Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm creating products using a frontend form which submits to <code>commerce/products/saveProduct</code> but it only works when I'm logged-in. They're really complicated products which need to be created on-the-fly.</p>
  
  <p>If it were my own plugin controller I was using, then I could just add <code>protected $allowAnonymous = true;</code> but as it isn't, how would I go about this?</p>
  
Tags: <plugins><plugin-craftcommerce><permissions>
Title: Override permissions for Craft Commerce saveProduct controller
ThreadText: # Override permissions for Craft Commerce saveProduct controller
  
  (Asked by: username_0 on 2016-12-20)
  
  I'm creating products using a frontend form which submits to `commerce/products/saveProduct` but it only works when I'm logged-in. They're really complicated products which need to be created on-the-fly.
  
  If it were my own plugin controller I was using, then I could just add `protected $allowAnonymous = true;` but as it isn't, how would I go about this?
  
  **Tags:** plugins, plugin-craftcommerce, permissions
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-12-20. Score: 2 | Accepted answer
  
  You'll have to write a custom plugin and point your frontend form to save to its own controller action that allows anonymous access.
  
  That action can either 1) duplicate Commerce's `saveProduct` method, which can be brittle if it changes or 2) start a session from a generic user account that has the proper permissions and [forward](http://www.yiiframework.com/doc/api/1.1/CController#forward-detail) the request onto Commerce's `saveProduct` method.
  
  
  ---
  
  