It's all about the answers!

Ask a question

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


Atul Kumar (1872029) | asked Sep 01 '14, 8:14 a.m.
edited Sep 01 '14, 8:15 a.m.
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 !

Comments
Ralph Schoon commented Sep 01 '14, 8:19 a.m. | edited Sep 01 '14, 11:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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


Tim Mok commented Sep 02 '14, 2:39 p.m.
JAZZ DEVELOPER

Are you using the item permissions feature? 


Atul Kumar commented Sep 08 '14, 8:05 a.m. | edited Sep 08 '14, 8:05 a.m.

@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.


Tim Mok commented Sep 08 '14, 8:38 a.m.
JAZZ DEVELOPER

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.


Atul Kumar commented Sep 09 '14, 1:36 a.m.

No, none of the accounts are admin accounts.

Accepted answer


permanent link
Atul Kumar (1872029) | answered Nov 18 '14, 5:11 a.m.
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

Your answer


Register or to post your answer.