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
Describe the Bug
When handling a fulfilled ModelPermissions promise, the permissions passed is undefined.
Step To Reproduce
When logged in using a JWT token, call modelService.permissions(modelid).getPermissions() on a model that exists and you have access to. The fulfilled promise will be undefined.
modelService.permissions(modelid).getPermissions()
.then((myPermissions: ModelPermissions) => {
if (myPermissions === undefined) {
console.log("Permissions is null!");
})
The problem occurs in ModelPermissionManager.getPermissions() which has this code:
getModelPermissionsResponse is actually an array and not a map, so when the session username (a string) is used, it will always return undefined. The code should be iterating over the array to find the proper match.
In the event that nothing is found, it should be returning an empty ModelPermissions that has all permissions set to false.
Expected Behavior
A non undefinedModelPermissions should be returned as part of the Promise.
The text was updated successfully, but these errors were encountered:
There s a third issue here, which is that the users that are coming back are full fledged users with a type and user name, and we are only looking at the username here:
So the returned map has only the username as the key, this is wrong since it will ignore anonymous or convergence users. We will use the above method, but must update it to account for various types of users. This means that the keys in the map will change. While not an API change, it is a semantic change.
Versions
Describe the Bug
When handling a fulfilled ModelPermissions promise, the permissions passed is undefined.
Step To Reproduce
When logged in using a JWT token, call modelService.permissions(modelid).getPermissions() on a model that exists and you have access to. The fulfilled promise will be undefined.
The problem occurs in
ModelPermissionManager.getPermissions()
which has this code:There are actually two bugs here.
getModelPermissionsResponse
is actually an array and not a map, so when the session username (a string) is used, it will always return undefined. The code should be iterating over the array to find the proper match.ModelPermissions
that has all permissions set to false.Expected Behavior
A non
undefined
ModelPermissions
should be returned as part of the Promise.The text was updated successfully, but these errors were encountered: