Teams/Groups
How would one extend the user and permissions model to have groups of users with shared access to authwalled areas? Would it make sense for this to be dynamically created roles or is there a better approach?
2 Replies
I would probably introduce a concept of
entity UserGroup
or Org or wahtever is the best name, and then have N to N relation between UserGroup and User. Then when trying to do somth with a resource, you can check if user belongs to the appropriate group, stuff like that. This is in case you want to allow users to create this groups and invite other users to them and so on.
If you just need a couple of fixed roles, then it can be as easy as introducing role
field on the User
entity and checking its value.
And if those roles should be able to be managed by some kind of other User, maybe admin, then you could make them dynamic by having entity Role
and assigning those to Users again.
Depends on what you need!
But nothign Wasp specific here I would say, just normal app/db design.Understood and good point, there's nothing tied to the templating really here. Cheers!