3 ms·
I like the approach explained here: http://www.try-alf.org/blog/2013-10-21-relations-as-first-class-citizen http://www.try-alf.org/blog/2013-10-21-relations-as
by mamcx 12y ago
I like the approach explained here:
http://www.try-alf.org/blog/2013-10-21-relations-as-first-class-citizen http://www.try-alf.org/blog/2013-10-21-relations-as-first-cl...
Is something like:
requester_city = 'Paris'
solution = suppliers
# 1). A supplier may only see information about the suppliers located
# in the same city than himself.
solution = restrict(solution, city: requester_city)
# 2) The supplier's `status` is sensitive and should not be displayed.
solution = allbut(solution, [:status])
# 3). The country name must be displayed together with the supplier's city.
solution = join(solution, cities)
The good idea is that is composable. You can query by all the solution =