I have a user and some groups. I am able to add the groups and with specific scope to the user using core service. What do i do if i need to add a group with all publications as its scope using core service. Below is my sample code.
GroupData group1 = CoreServiceClient.Read("tcm:0-187-65568", null) as GroupData;
UserData userData = CoreServiceClient.Read("tcm:0-49-65552", null) as UserData;
GroupMembershipData groupmembership1 = new GroupMembershipData();
LinkToGroupData linktogroupData1 = new LinkToGroupData();
linktogroupData1.IdRef = group1.Id;
linktogroupData1.Title = group1.Title;
groupmembership1.Group = linktogroupData1;
LinkWithIsEditableToRepositoryData pubLink1 = new LinkWithIsEditableToRepositoryData();
pubLink1.IdRef = "tcm:0-1-1";
pubLink1.Title = "Content";
LinkWithIsEditableToRepositoryData pubLink2 = new LinkWithIsEditableToRepositoryData();
pubLink2.IdRef = "tcm:0-3-1";
pubLink2.Title = "Design";
LinkWithIsEditableToRepositoryData[] pubArray1 = { pubLink1, pubLink2 };
groupmembership1.Scope = pubArray1;
GroupMembershipData[] groupArray = { groupmembership1 };
userData.GroupMemberships = groupArray;
CoreServiceClient.Save(userData, null);