0

我正在开发一个门户网站,并希望实现一个注册机制,在该机制中,具有某些素质的人将被激活以使用该门户网站。

这是我正在寻找的两件事:

    1]
    As a simple example, anyone who went to stanford and berkley could use it (So email should have @stanford.edu OR Linkedin Profile should indicated similar etc) . This could be extended to other similar constraints. 

    For now, its fine if I have to manually visit LinkedIn page, or exchange some emails before the approval is done.  

    2] 
    Some users with a pre-generated code are allowed to signup irrespective of above constraints. Eg a Gift card that has a membership pre-approved. 

3] 
This is not important , but there could be some pages/routes that could be available to everyone without approval. 

我正在寻找一个 Gem 来执行此任务或任何有关如何快速优雅地实施此任务的建议。如果解决方案只是扩展到说 10K 用户,那很好。

谢谢!

PS:目前我正在使用 Devise 和 Omni-auth 来支持身份验证,所以如果新解决方案能够支持这些会更好

4

1 回答 1

0

按照有关审批的Devise Wiki 页面进行审批流程的初始设置,当新用户通过AdminMailer邮件注册时,它将通知您(或您选择的任何人)。

然后,通过使用before_create回调,您可以检查您的自定义验证,即:

def approved_via_linked_in?
    # perform logic here...
end

并且,您可以对从您发送的电子邮件设置条件,AdminMailer仅在用户尚未通过您的自定义验证批准时发送。

于 2013-09-26T15:40:31.810 回答