Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have just upgraded from 7.5.9 to 7.7 and see where the umbracoUserType and umbracoUser2app tables have been replaced with umbracoUserGroup and umbracoUser2UserGroup, which is fine.
But for me, I need to insert/delete into this table based on what the user has in Active Directory.
I could use Entity Framework to do my work but wanted to make sure I wasn't missing anything by not using the Umbraco UserService object.
I did find a userService.AddGroup() but its read only.
Question: Is there an Umbraco object API call that will allow me to add a group to an existing user?
You can easily add Groups to User with AddGroup function of IUser.
public void MakeAdmin (IUser user)
IUserService _userService = ApplicationContext.Current.Services.UserService;
// how to remove a group from user
// get Admin group
var adminGroup = _userService.GetUserGroupByAlias("adminAlias") as IReadOnlyUserGroup;
// how to add a group to user
// save user
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted