Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Management API #3471

Open
ianlgnk opened this issue Sep 15, 2022 · 0 comments
Open

User Management API #3471

ianlgnk opened this issue Sep 15, 2022 · 0 comments

Comments

@ianlgnk
Copy link

ianlgnk commented Sep 15, 2022

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant