title: How to use permission based functions in react frontend with Django Rest API?
body: <p>I use Django Rest Framework with React on the frontend. I use Token Athentication and everything works fine. I now want to implement some permission based functions in my React frontend. More specifically, I want the author of a post to be able to edit the post, but all other users not. How can I achieve this?</p>
  
  <p>My idea is that I add an <code>is_viewing_own_story</code> as a boolean to the user model in the django backend. When the author now clicks on the post, redux updates this state to 'true' and the buttons for deleting and updating stories appear (<em>if</em> <code>is_viewing_own_story=true</code> show buttons <em>else</em> show nothing). </p>
  
  <p>I'm not sure if this is the smartest way or if there is a best practice?</p>
  
  <p>If there is anything to read about, or any git hub repo to inform im happy to study that.</p>