简体   繁体   中英

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. 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! Been at this for 3 days, no sleep. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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