view permissions retrieve users
Hello Data Citizens Community,
I need help with retrieving users assigned to a view permission on an asset level. We are trying to develop a workflow with creating data assets and we want those assets to be only visible to the roles in the workflow. We were able to create addViewPermission api script that adds users to the view permissions. The issue happens when the same user, that was previously added into the view, is trying to start a new workflow. After starting a workflow again this error shows up:
“Value not allowed
The given user or group already has a view right for this resource.”
The user is already in the view permissions and the workflow cannot add the user again. We are trying to get a list of users that are being added in the workflow and then get a list of users that are already in the view permissions. We want to compare those lists and remove duplicate values. We are having issues with getting the list of users that are already in the view permissions. We could not find any api documentation about being able to do that. Does anyone have experiences with this and could help us?
Any help would be highly appreciated.
Thank you!
davidnovosad1
OP3 years ago · EditedHi everyone,
Just wanted to give an update. The comment from Stefan Busch worked. We created a list of users that need to be added into the view permissions. Included the addition API from Roeland in the try block of the code and if the user is already assigned to the view permission we catch the error in the catch block of the code and continue looping through the list of users.
Thank you for your help!
roelandherrebosch
·3 years ago · EditedWould this API do the trick: https://developer.collibra.com/apis/java/javav2/com/collibra/dgc/core/api/dto/viewpermission/FindViewPermissionRequest.Builder.html
Use parameters
You could even pass the userId of the relevant user if your don’t need to know if there are other users.
stefan_busch
·3 years ago · EditedHi,
I do not know of an api for what you are trying to do, but if you assign the user to the view permission via a script task then maybe using a try catch block in the code could solve the problem.
Cheers,
Stefan