this pr includes the flow for secret code authentication for groups
db changes
added user_can_view and user_can_create on a group category level, the goal behind this is to be able to distinguish our flows on frontend and adding an extra layer of security. For example, for joining a polize group we would set view:true and create:false and for secret group authentication it would be switched around to create:true and view:false
added secret column to groups and made the secret unique
endpoints
GET group-categories/:id/groups: allows users to get a list of groups if authorization is correct
POST groups/: creates a group with a secret and assigns user to group
POST users-to-groups/: joins a group with a secret value passed through the payload
edge cases
there is an edge case where a user can create groups and join groups if he knows the secret and is not accepted in the registration. i think this is not something that we will encounter but is possible and could be improved
overview
this pr includes the flow for secret code authentication for groups
db changes
view:true
andcreate:false
and for secret group authentication it would be switched around tocreate:true
andview:false
endpoints
edge cases
there is an edge case where a user can create groups and join groups if he knows the secret and is not accepted in the registration. i think this is not something that we will encounter but is possible and could be improved