Hey guys, I'm working on a project with a team for school. We want to be able to assign users' specific roles (such as Players, Team Captain, or Referee) through code!
Should I be using Custom Attributes for setting a user's admin role? Or should I be assigning them into Groups?
As well, how would I update a user's role through code (Next.js)?
Thanks guys, I appreciate it, if you have any questions, please let me know!
Justin
#✅ - For giving users admin roles, should I be assigning Custom Attributes or Groups?
1 messages · Page 1 of 1 (latest)
Hi @fleet forum this can be done using Groups and is what i would recommend, as you can restrict access per group. [1]
Then to programmatically add users to groups, you can enable admin actions [2] on our auth resource and use the addUserToGroup admin query api [3].
[1] https://docs.amplify.aws/cli/auth/groups/#group-access-controls
[2] https://docs.amplify.aws/cli/auth/admin/#enable-admin-queries
[3] https://docs.amplify.aws/cli/auth/admin/#admin-queries-api
✅ - For giving users admin roles, should I be assigning Custom Attributes or Groups?