permissions - Ruby on rails 4 - What would be the best way to allow one user to see the data of another user -
i want allow 1 user on app chose can see own data, don't know if i'm clear here example :
user creates data on table , can see own data and/or decide share user.
user b can see data user allowed him so.
i thinking of random token generated when user created , user can decide share token else , display data based on token?
it depends on "business rules" here. instance, in application developed read rights based on "privacy levels". privacy level 0
meant can view data whereas privacy level 1
denoted view data. of queries tailored datapoint, , model relation user denoted "owner."
so in scheme, propose system each record has it's own permission token, system used in google docs. totally valid way of sharing records in system. more complex allowing users add users record, might optimal solution use case.
anyway, few thoughts on subject. let me know if helps.
Comments
Post a Comment