I have kind of multi-tenant application. I have many groups, users belongsTo one group. Group has many different models e.g. news, files etc. Users have access only to elements of their group. It is similar to the 'teamMember' example on the Loopback docs, in my case I have `groupMember', so when user is trying to access, I check if User.groupId === Model.groupId
The issue which I have, is that I need to have roles for those groups.
So, e.g. basic, privileged, admin. Basic can access some of methods, privileged more than basic but not all of them and admin can access all methods, but ONLY FOR ELEMENTS of his group.
So, in my understanding I have to combine - groupMember and e.g. admin, but I have no idea how to do that.
Anyone can help? I think it's quite common thing.
