Implements a permissions system for Rails api endpoints and devise users