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

unable to assign same role for user on tenant in global, and same tenant in default domain #12

Closed
Vuader opened this Issue Apr 10, 2018 · 1 comment

Comments

@Vuader
Contributor

Vuader commented Apr 10, 2018

This is with running sqlite

To reproduce:

$ token=`curl -H "Content-Type:application/json; charset=utf-8" -d '{"username": "root","password": "password"}' http://localhost/api/v1/token | grep token | awk -F \" '{print $4}'`
$ tenant_id=`curl -H "Content-Type:application/json; charset=utf-8" -H "X-Auth-Token:$token" -d '{"name": "test"}' http://localhost/api/v1/tenant | grep id | awk -F \" '{print$4}'`
$ curl -H "Content-Type:application/json; charset=utf-8" -H "X-Auth-Token:$token" -X "POST" http://localhost/api/v1/rbac/user/00000000-0000-0000-0000-000000000000/b5222990-2578-49ad-81e4-02d1082c9ad5/none/$tenant_id

Then:

curl -H "Content-Type:application/json; charset=utf-8" -H "X-Auth-Token:$token" -X "POST" http://localhost/api/v1/rbac/user/00000000-0000-0000-0000-000000000000/b5222990-2578-49ad-81e4-02d1082c9ad5/default/$tenant_id

results in:

{
    "error": {
        "title": "500 Internal Server Error",
        "description": "UNIQUE constraint failed: luxon_user_role.role_id, luxon_user_role.tenant_id, luxon_user_role.user_id"
    }
}

@Vuader Vuader added the bug label Apr 10, 2018

@cfrademan cfrademan added this to To Do in Beta/First Release via automation Apr 18, 2018

@cfrademan cfrademan added this to the BETA RELEASE milestone Apr 18, 2018

@cfrademan cfrademan added this to To Do in Authentication Service via automation Apr 18, 2018

@cfrademan cfrademan added this to To Do in NFV Automation via automation Apr 18, 2018

@IanKruger IanKruger moved this from To Do to Priority in Beta/First Release Apr 25, 2018

@cfrademan cfrademan moved this from To Do to Priority in NFV Automation May 13, 2018

@cfrademan cfrademan moved this from To Do to Priority in Authentication Service May 13, 2018

@Vuader

This comment has been minimized.

Contributor

Vuader commented Jul 12, 2018

This is the reason:

https://github.com/TachyonicProject/infinitystone/blob/development/infinitystone/models/user_roles.py#L58

@cfrademan any particular reason for excluding the domain from the unique constraint?

Vuader pushed a commit to Vuader/infinitystone that referenced this issue Jul 19, 2018

Vuader added a commit that referenced this issue Jul 19, 2018

@Vuader Vuader closed this Jul 19, 2018

Beta/First Release automation moved this from Priority to Completed Jul 19, 2018

NFV Automation automation moved this from Priority to Completed Jul 19, 2018

Authentication Service automation moved this from Priority to Completed Jul 19, 2018

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