Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Getting PermissionDeniedException on programmatically getting WorkspaceManager of other user's workspace

Hi,

I'm accessing other users' workspace programmatically. When the workspace's permission is "private", sometimes another user gets PermissionDeniedException.

Following is the way I'm getting the IVersionable:
IVersionableHandle versionHandle = (IVersionableHandle) IFileItem.ITEM_TYPE.createItemHandle(                UUID.valueOf(fileUuid), UUID.valueOf(stateUuid));
IVersionableManager verManager = SCMPlatform.getWorkspaceManager(repository).versionableManager();
return verManager.fetchCompleteState(versionHandle, monitor);

But the problem is that I'm not getting this exception systematically. For the same user/otherUser combinations, sometimes it works fine without any exceptions too !

0 votes

Comments

You don't get the permission on getting the IVersionableManage, I assume you get it on retrieving the versionable handle.Right?

Are you using the item permissions feature? 

@Ralph - I get the PermissionDeniedException while getting workspace connection.
i.e.,
 IWorkspaceConnection workspaceConnection = SCMPlatform.getWorkspaceManager(repository).getWorkspaceConnection(workspaceHandle, monitor);
IFlowEntry defaultDeliverFlow = workspaceConnection.getFlowTable().getDefaultDeliverFlow();
...
...

@Tim - No, on attempting to create workspace connection itself, I get this exception.

Are you accessing this workspace using an admin account? You say the other user's workspace is private but you don't mention that your user account is admin.

No, none of the accounts are admin accounts.


Accepted answer

Permanent link
I resolved this issue by doing-away with accessing workspace to have versionables. Now, I use only the change-set details to find versionables.
Ralph Schoon selected this answer as the correct answer

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,930

Question asked: Sep 01 '14, 8:14 a.m.

Question was seen: 3,292 times

Last updated: Nov 18 '14, 5:20 a.m.

Confirmation Cancel Confirm