Hi to all,
I need that users can see/update entities record where the area of the record is equal to user area, I'll try to explain what i test.
1. Add new custom entity 'areas'
2. Add 1:N relationship 'users' (1) => (N) 'areas'
3. Add lookup field to 'areas' in one ore more entities eg. 'contacts'
4. Add new entity user_to_contacts that has these relationships: (1) user => (N) user_to_contacts, (1) contacts => (N) user_to_contacts.
5. Add new grid for 'users' that filter on currentuser.id = user_to_contacts.user_id
6. When add/remove an area from a user update user_to_contacts adding/removing records
7. When add/remove/change contact's are update user_to_contacts adding/removing records
PS: i tried 1 to 5 step and it works, instead of use 'users' i think it works also with 'teams' entity.
My questions are:
Is this a good and practicable idea? If yes, some one can explain me ho to do 6 and 7 points?
Is there a smarter approach to do this? I try also to create a TeamArea1, TeamArea2 ..... TeamAreaN and assign the records to the team and not to the users security is not exported for solutions.
Thanks in advance