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

Difficulty in setting visibility of a component to access group

 Hi,

I am trying to change visibility of a component to access group using setComponentOwnerAndVisibility() method of IWorkspaceManager.  
1. I have created access group using: 
IAccessGroupClientService clientService = (IAccessGroupClientService) repo.getClientLibrary(IAccessGroupClientService.class); 
IWorkItemCommon workItemCommon = (IWorkItemCommon)repo.getClientLibrary(IWorkItemCommon.class); 
IAccessGroup accessGroup = (IAccessGroup) workItemCommon.getAuditableCommon().createAuditable(IAccessGroup.ITEM_TYPE); 
accessGroup.setName("Test_AccessGroup_1"); 

2. Added required team areas to this access group:
accessGroup.add(team, ReadAccessContextType.MEMBERS);  
   
3. Setting visibility of a  component using: 
wm.setComponentOwnerAndVisibility(component, owner, (IReadScope) IReadScope.FACTORY.createAccessGroupScope(accessGroup), monitor); 

But getting  java.lang.IllegalArgumentException for this method
java.lang.IllegalArgumentException
at com.ibm.team.repository.common.model.impl.ItemTypeImpl.createItemHandle(ItemTypeImpl.java:151)
at com.ibm.team.scm.common.internal.dto.impl.AccessGroupScopeImpl.setAccessGroupId(AccessGroupScopeImpl.java:226)
at com.ibm.team.scm.common.dto.IReadScope$1.createAccessGroupScope(IReadScope.java:133)
Anyone has any clue?

0 votes



One answer

Permanent link

 https://rsjazz.wordpress.com/2016/02/03/setting-access-control-permissions-for-scm-versionables/ explains the API for that. 


IPermissionContextProvider accessGroupContext = IPermissionContextProvider.FACTORY.create(accessGroupHandle);
    
provides the context.

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,927

Question asked: Mar 28 '17, 6:52 a.m.

Question was seen: 1,541 times

Last updated: Mar 28 '17, 7:06 a.m.

Confirmation Cancel Confirm