简体   繁体   English

有人可以解释一下向Rails应用添加多租户的简单方法吗?

[英]Can someone please explain a simply way to add multi-tenancy to a rails app?

I have a bootstrapped layout running on my rails app with the ability to allow users to sign up, sign in and sign out. 我在Rails应用程序上运行了一个引导式布局,该布局允许用户注册,登录和注销。 Even changing layouts when they do sign in, to provide a dashboard feel across the nav, as I offer them links they can access to separate pages with forms they can create for work use. 即使我登录时更改布局,也可以在整个导航栏中提供仪表板的感觉,当我向他们提供链接时,他们可以访问单独的页面,并可以创建供工作使用的表单。 However, although users can sign up and log in, any forms they created can be viewed by ANY other user... How do I separate this for privacy? 但是,尽管用户可以注册并登录,但是任何其他用户都可以查看他们创建的任何表格。如何保护隐私? I am new, and this is for a project I am doing in class. 我是新来的,这是我在课堂上做的一个项目。 Needless to say they left a lot out and keep telling me to google it.. Super stressed out over here! 不用说,他们遗漏了很多东西,并继续告诉我使用Google进行搜索。 Been at this for 3 days, no sleep. 在这里住了3天,没睡。 Please help! 请帮忙!

Some things to look at: 一些事情要看:

  • Userstamp - record who created the record(s) 用户戳 -记录创建者
  • Scopes - limit what comes back in a query easily 范围 -轻松限制查询中返回的内容
  • CanCan - easily add authR that will hook in with your existing User model/auth, or you can use Devise, AuthLogic, etc. with it 康康舞 -轻松添加AUTHR,将钩与现有的用户模型/ AUTH,或者您可以使用设计,AuthLogic,等它

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

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