You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've faced a problem that is OpenBoxes API doesn't have support to control properly the roles of a user. For some reason, when you try to pass many roles on a POST or PUT in the "generic/api/user" with:
{
"roles[0].id": "3",
"roles[1].id": "5"
}
Look what happened in the database:
mysql> select * from user_role where user_id = 2;
+---------+---------+
| user_id | role_id |
+---------+---------+
| 2 | 3 |
| 2 | 3 |
+---------+---------+
2 rows in set (0.01 sec)
It duplicates the first role for the user, trying to pass 3 roles, it will triplicate, and follow this bug for all roles you pass.
Another question is, it could be possible to catch all the roles associated to an user by his id, this would help so much to control OpenBoxes user access by your own system using API. Until now, I haven't found a way to do it...
The text was updated successfully, but these errors were encountered:
I've faced a problem that is OpenBoxes API doesn't have support to control properly the roles of a user. For some reason, when you try to pass many roles on a POST or PUT in the "generic/api/user" with:
Look what happened in the database:
It duplicates the first role for the user, trying to pass 3 roles, it will triplicate, and follow this bug for all roles you pass.
Another question is, it could be possible to catch all the roles associated to an user by his id, this would help so much to control OpenBoxes user access by your own system using API. Until now, I haven't found a way to do it...
The text was updated successfully, but these errors were encountered: