I am developing a Ruby (api backend) + Nuxt (frontend) application and thinking what would be the best approach for authorization.
Should I use app_metadata to store a json similar to the following code or build that functionality in application itself? I need to grant permission/role to a user or group on resource level. E.g. one user can have write permission in project A, but only read for project B etc.
"organizations": [
{
"id": "1",
"key": "my-org",
"roles": {
"organizations": [
{
"id": "1",
"key": "my-org",
"role": "Organization Admin"
},
{
"id": "2",
"key": "my-project",
"role": "Project User"
}
],
"projects": [
{
"id": "1",
"key": "my-project",
"role": "Project Admin"
},
{
"id": "2",
"key": "my-project",
"role": "Project User"
}
]
}
}
]