It's all about the answers!

Ask a question

Java API extending - Error 'CRRTC5039E User ... is not allowed to access content ...'


Peter Moraza (481924) | asked Sep 26 '13, 4:55 p.m.
Hi,

I'm getting a TeamRepositoryException 'CRRTC5039E User test is not allowed to access content vPbUZqbY7OMeYf5ruYxLYEbJOi7ko3ewxIaWNquf0vM'. 'vPbUZqbY7OMeYf5ruYxLYEbJOi7ko3ewxIaWNquf0vM' is the storedContent stringHash. The 'test' account did the initial deliver of the file to the stream. The exception is thrown in the workspace.commit() method while trying to commit an update to the stream. I get the IFileItem file by locating the existing version in RTC. Any idea what I am doing wrong?

File f = new File(localPath + ".project");
byte[] b = new byte[(int) f.length()];
IFileContent storedContent = contentManager.storeContent(IFileContent.ENCODING_US_ASCII, FileLineDelimiter.LINE_DELIMITER_PLATFORM, new VersionedContentManagerByteArrayInputStreamPovider(getByte(f, b)), null, monitor);
file.setName(".project");
file.setParent(tmp);
file.setContent(storedContent);
file.setFileTimestamp(new Date());
file = (IFileItem) file.getWorkingCopy();
wkspccnctn.commit(cs1, Collections.singletonList(wkspccnctn.configurationOpFactory().save(file)), monitor);

Peter

Accepted answer


permanent link
Ralph Schoon (63.1k33645) | answered Sep 30 '13, 8:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Have you tried this with a user that has more permissions on the repository? E.g. ad the user to the project area, make sure all permissions to read and write this data has been granted. Assuming you run on a test repository, you could give the user all permissions and then try to limit it.
Peter Moraza selected this answer as the correct answer

Comments
Peter Moraza commented Oct 02 '13, 11:37 p.m.

I added all permissions to the user and made a few changes to the code, and I'm now able to deliver the updated file to the stream with no errors, but this has opened up a few other issues. After the update, the Eclipse project folder in the Resource perspective does not have the "shared"  icon (looks like a cylinder). I am able to see the repository files in the stream, but when I try to open the local file from the repository files view I get the message "File does not exist locally". Further manual changes to the file does not display a status change in Pending Changes view. This happens with projects I've added to Jazz via the API, "shared" icon, local file available and Pending Changes status update all work when I have delivered the first version via the RTC client. Must have overlooked something in my code for delivering new files (based on Snippet2). I'll likely open a new topic in the Forum to tackle this. Thanks RS for getting me this far!



Peter Moraza commented Oct 03 '13, 9:24 p.m.

I believe the additional permissions made the revision delivery possible more than the code changes I had made, so I am marking Ralph Schoon's answer as the "accepted answer".

Your answer


Register or 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.