Java API extending - Error 'CRRTC5039E User ... is not allowed to access content ...'
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
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.