Closed escoand closed 5 years ago
Sorry but I can't reproduce this. I created 3 roles and can assign them to users without a problem...
{
"permissions": [
{
"href": "http://localhost:8080/perm/d851aef9-3ced-4aa9-9803-cfe5a64cf44f",
"id": "d851aef9-3ced-4aa9-9803-cfe5a64cf44f",
"match": "read-only",
"scopes": [
"read"
]
},
{
"href": "http://localhost:8080/perm/0cc50400-f7ea-4961-ae47-024711b9fec7",
"id": "0cc50400-f7ea-4961-ae47-024711b9fec7",
"match": "read-write",
"scopes": [
"write"
]
},
{
"href": "http://localhost:8080/perm/fafed461-c1cc-4583-8437-7047ae2bc6bb",
"id": "fafed461-c1cc-4583-8437-7047ae2bc6bb",
"match": "websys",
"scopes": [
"admin"
]
}
],
"status": "ok",
"total": 3
}
The error doesn't help me much either. It's just a trackback of angular framework code. There doesn't seem to be a reference to any alerta web UI code. Any chance there is more to that error than you managed to capture? Or anything else that might help debug this?
Found the reason with this: https://docs.angularjs.org/error/ngRepeat/dupes
So I tested with:
<span ng-repeat="role in roles track by $index">{{ $index }}:{{ roles[$index] }}, </span>
And got:
0:user, 1:ams, 2:user,
The question is now: where is the second user coming from? /api/perm is just exposing 2 roles.
Is it maybe because I've created the "user" role explicitly?
yes. you should modify the server configuration to set permissions for the default "user" role...
USER_DEFAULT_SCOPES = ['read', 'write'] # Note: 'write' scope implicitly includes 'read'
thanks, it's working now. but maybe this could be described more clearly or maybe the controller should test if user is already existing.
It's probably both. ie. documentation should be better and the API should probably reject user-defined roles called "admin" and "user".
roles dropdown empty in user view
I've a problem with the user view, especially with the roles drop down. They are empty and so it's impossible to change the role of a user via gui.
The data is loaded via API correctly:
The thrown error in the JavaScript console is: