As an admin, I created a role to access workspace content and have been trying to access workspace content by pointing an application to a user with that role.
But I see the error “workspace role for workspace *************** not found”, User not permitted to perform this action.
What is missing, why is the user not permitted to perform the action.
As an admin, I created a role to access workspace content and have been trying to access workspace content by pointing an application to a user with that role.
Even as an admin, both organization admin or instance admin, we do not allow access to the content of workspaces unless you are the workspace owner or a workspace collaborator. This is by design for security reasons. An org admin can manage what users are members of an org and general organization management, but can never directly access the content in workspaces unless given explicit permissions from the workspace owner.
A few questions:
What is the use case you are trying to solve? Perhaps there is another solution to help solve your problem.
We have instance admin, and org admin. Instance admin is only for on-prem customers, so I’m guessing you are an Organization Admin. Can you confirm?
We are trying to audit workspaces for content which is not meeting the compliance requirements.
I added a user with org admin role as a collaborator for a workspace to test and created a new app. I am using the credentials of that app to access the workspace content.
{'errors': [{'name': 'ForbiddenError', 'message': 'workspace role for workspace 9iJvJBjMNxmDjeYgRYaL not found: {"requestId":"094ed706-c1b9-4516-8c04-8821a6cbfe7e","uuid":"04abe2ab-e874-47be-919a-48384aa6130d","code":"UserForbidden","message":"User not permitted to perform this action"}', 'statusCode': 403}]}
All the management api’s work fine but content api’s do not seem to work even though I have right permissions. I also have the user added as editor for the workspace but still the query does not work.
It’s interesting that you aren’t able to list your own workspaces from /v3/users/me/workspaces, you must have something wrong with your custom role.
A few more follow up questions:
For 2. I am using app’s id and secret and using identity-**********/api/v2/oauth2/token to get the token
What OAuth method are you using to generate the token?
Are you using the code flow, which requires the user to manually authorize API access? You would need the user login information and go through authentication before authorization to generate the access code.
For 4. I see the right user in /me
And this is the org admin user? Or is this the user that is added as the workspace collaborator?
For 5. I see the permission in the role. This is from a custom role.
What is the resource type for the custom role? How did you create the role? Can you try switching back to the default role?