-1

Disclaimer: I'm not using Devise, My authentication is being handled using bcrypt.

I want to know what are my best options, for the long run in adding roles to my users. For a while my users have been my Company model, and I've been holding off on creating an actual User model until now. My users will consist of upper level management, managers, and regular employees.

I don't know if I'm over complicating it, but I feel like dealing with this with a simple boolean on the User record is too simple. I think that's too simple because I know that there are gems that handle this like Rolify and CanCan. Can I get some advice/tips that will benefit me for the long-term.

gemart
  • 346
  • 1
  • 3
  • 18

2 Answers2

0

Changing my answers as I did not see the disclaimer before. Use JWT with Auth0. Below is the website to Auth0. https://auth0.com/

Auth0 will take care of all the permission/role issues if you set it right. It is also incredibly flexible as you scale.

0

I would just add a new column to the user table

add_column :users, roles, :integer, default: 0

and for exemple on your user model

enum role: [:contributor, :owner, :supervisor]

johan
  • 721
  • 5
  • 21