简体   繁体   English

Rails身份验证和授权-最佳方法?

[英]Rails Authentication and Authorization - Best approach?

I've been battling at how to accomplish this for a while and even started working on different solutions only to notice it's not very practical or could lead to problems. 我一直在努力实现这一目标,甚至开始研究不同的解决方案,只是发现它不太实用或可能导致问题。

Scenario: A user can create an Admin account and invite (mail invite) another user as a Client. 方案:用户可以创建一个Admin帐户,并邀请(邮件邀请)另一个用户作为客户端。 I was thinking of using the devise_invitable gem to handle the invitation process. 我当时正在考虑使用devise_invitable gem处理邀请过程。 I'm not sure if I should have 2 models (Admin/Client). 我不确定是否应该有2个模型(管理员/客户端)。

Gems I've been considering: devise devise_invitable cancancan pundit rollify 我一直在考虑的宝石:设计devise_invitable cancancan pundit rollify

The thing is that whatever setup I use for authentication and authorization must comply with devise_invitable gem given that its a load of my mind to build that functionality myself. 事实是,无论我用于身份验证和授权的任何设置都必须符合devise_invitable gem,因为这是我自己构建该功能的重担。

Devise and Oauth 2.0. Devise和Oauth 2.0。 If you need an admin panel you can use rails_admin or there are a variety of admin gems as well, Or you can make your own. 如果需要管理面板,则可以使用rails_admin,也可以使用多种管理工具,也可以自己制作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM