Adding permissions.py with a method for authenticating user permissions, and including this in rest.py