It's all about the answers!

Ask a question

How to create access groups programmatically?


ast java (4512049) | asked Jul 25 '16, 7:55 a.m.
retagged Aug 05 '16, 3:23 p.m. by Ken Tessier (84117)
  Hi Team,

Please let me know how to create access groups programmatically?

Thanks in advance.

Comments
sam detweiler commented Jul 25 '16, 8:27 a.m.

what is an 'access group'? I know team area and role..


sam detweiler commented Jul 25 '16, 12:17 p.m. | edited Jul 25 '16, 12:17 p.m.

David Lafreniere commented Jul 25 '16, 12:52 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Reply to: "access group are new since 6.0.1".

Technically this is inaccurate. Access Groups have been around since RTC 4.0 and could be used to customize the read access of work items. In RTC 6.0.1 however, access groups could be used to customize the read access of SCM artifacts.

Accepted answer


permanent link
Miguel Tomico (5001423) | answered Jul 25 '16, 11:35 a.m.

Java Client API code:

IAccessGroupClientService clientService = (IAccessGroupClientService) repo.getClientLibrary(IAccessGroupClientService.class);
IWorkItemCommon workItemCommon = (IWorkItemCommon)repo.getClientLibrary(IWorkItemCommon.class);
accessGroup = (IAccessGroup) workItemCommon.getAuditableCommon().createAuditable(IAccessGroup.ITEM_TYPE);
accessGroup.setName(strAccessGroupName);

//Add at least one IProjectArea, ITeamArea or IContributor
accessGroup.add(projectArea, ReadAccessContextType.MEMBERS);

clientService.save(accessGroup, null);

ast java selected this answer as the correct answer

Comments
ast java commented Jul 26 '16, 1:08 a.m.

 Thanks a lot Miguel Tomico.

One other answer



permanent link
Ken Tessier (84117) | answered Aug 05 '16, 3:23 p.m.
FYI, for more info. about access groups, see Using access groups to control access to artifacts

Ken

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.