Protecting Data in a Specific Domain in Rails

We have an application that is multi-user (many users who access their own data, similar to something like Basecamp).

Question: What is the easiest and easiest way in Rails to provide users with the ability to see only their account information? Is this a case of passing and checking each request?

+3
source share
2 answers

The way to do this is:

  • Use subdomains, therefore its customer.domain.com .... Then in your application controller a subdomain will be found before the filter and set the @customer variable
  • , @customer.quotes.find(params [: id])... Quote.find(params [: id])

, , .

+3

, current_user, . .

, current_user. . , , , current_user.posts.all current_user.posts.find().

cookie " ", . , , .

0

Source: https://habr.com/ru/post/1776249/


All Articles