Is it possible to assign a user a custom role on a folder via the API? We're able to to assign the out-of-the-box roles like Creator and Viewer, but all custom roles return an error. The id assigning roles is an Admin so I don't think it's a permissions issue.
Answers
Hi Adam,
It should be possible to assign a custom role for access for a user using the public REST API (https://demo.hosted.panopto.com/Panopto/api/docs/index.html#/Folders/Folders_CreatePermission). You will need to use the
RoleIdfield instead of theRoleTypefield. We do not currently have an API to get the role IDs, however, you should be able to find them by logging into Panopto as an administrator, then going to System -> Roles, and clicking on the custom role you want. The ID of the role should appear in the URL after the hash mark (#) once you click on the role to expand it.You can use this ID as the
RoleIdin the call to the REST API to add permissions.If you are still seeing an error, or have any other questions, please let me know.
Thanks,
Kevin
We used the custom "RoleId" that we had pulled from an existing folder with that role. It returned an error of "Unsupported Role value". Using the same calls, we were able to assign Creator and Viewer roles, but not any of our custom roles.
Hi Adam,
Thank you for sending me the error message you are seeing. I've taken a look, and it does appear that there is a bug causing you to see that error when you attempt to use a custom RoleId to set permissions on a folder or a session.
I've filed an internal bug in our issue-tracking system to get this fixed as soon as we can.
If you have any other questions, please let me know.
Thanks,
Kevin