title: Sails.js authentication for model actions
body: <p>I'm making an API that has different levels of access, the 'client' may only read. But 'admin' must have write access. The different roles are check every time as a policy in Sails.js and sets the rights in the req.session. </p>
  
  <p>I just need to give the 'client' no access to create, update and delete actions, therefore i created an controller that has those CRUD actions and checks if the user has the right role. All of the actions that has restricted access are redirected trough routes.js to this controller. </p>
  
  <p>Now my problem is that when i'm deleting an entry like: Category.destroy(req.param('id')); Gives me undefined and has no done method. Unlike mentioned by the docs I managed to fix the problem by creating this:</p>
  
  <pre><code>   var deleted = Category.destroy(req.param('id'), function(err, status) { 
      if (status == 1){
        res.json({message: 'Category is deleted'});
      } else {
        res.json({message: 'Oops, something went wrong'});
      }
    });
  </code></pre>
  
  <p>But there has to be another way to apply authentication to those basic actions. Because now i've to write all actions.</p>
  
  <p>Is there something wrong with the code for the delete function that i wrote? And is it possible to apply policies and redirect to default model actions, as if there was no authentication at all?</p>