title: Django Rest Framework custom permissions per view
body: <p>I want to create permissions in Django Rest Framework, based on view + method + user permissions.</p>
  <p>Is there a way to achieve this without manually writing each permission, and checking the permissions of the group that the user is in?</p>
  <p>Also, another problem I am facing is that permission objects are tied up to a certain model. Since I have views that affect different models, or I want to grant different permissions on the method PUT, depending on what view I accessed (because it affects different fields), I want my permissions to be tied to a certain view, and not to a certain model.</p>
  <p>Does anyone know how this can be done?</p>
  <p>I am looking for a solution in the sort of:</p>
  <ol>
  <li><p>Create a Permissions object with the following parameters: <code>View_affected</code>, <code>list_of_allowed_methods(GET,POST,etc.)</code></p>
  </li>
  <li><p>Create a Group object that has that permission associated</p>
  </li>
  <li><p>Add a user to the group</p>
  </li>
  <li><p>Have my default permission class take care of everything.</p>
  </li>
  </ol>
  <p>From what I have now, the step that is giving me problems is step 1. Because I see no way of tying a Permission with a View, and because Permissions ask for a model, and I do not want a model.</p>