It's all about the answers!

Ask a question

Is there a simple API that can determine if a contributor has access to a component?

Jeff Care (1.0k3833) | asked Sep 08 '14, 5:21 p.m.
edited May 23 '16, 10:28 p.m. by David Lafreniere (4.8k7)
Relative to defect 328755 I'm attempting to write a program (using the plain Java API) that can fix user's workspaces, removing components that they don't have access to.

I'm finding it difficult to navigate read scopes & owners for components and then tie that information back to who can actually view a component. I find it hard to believe that the code I'm in the middle of writing (i.e. navigating the IReadScope of an IComponentHandle) hasn't been done already in RTC. Ideally I'm looking for an API like this:
boolean canRead (IContributorHandle, IComponentHandle)
Does something like this already exist in a usable form somewhere? I've looked & can't find anything. I can't believe that there's no higher level abstraction available for something as important as access control...

Accepted answer

permanent link
Remy Suen (426124) | answered Sep 09 '14, 1:16 p.m.
There is no API exposed for something like that. We probably grind out the information internally but even for that case we are just checking it against the user that's currently logged in to the repository (given that we have no UI that shows you some cross mapping of who-sees-what-components in RTC).
David Lafreniere selected this answer as the correct 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.