/// <summary> /// Deletes group. Called when the "Delete group" button is pressed. /// Expects the CreateGroup method to be run first. /// </summary> private bool DeleteGroup() { // Get the group GroupInfo deleteGroup = GroupInfoProvider.GetGroupInfo("MyNewGroup", CMSContext.CurrentSiteName); // Delete the group GroupInfoProvider.DeleteGroupInfo(deleteGroup); return(deleteGroup != null); }
private void btnDelete_Click(object sender, EventArgs e) { // Only community manager can delete group if (!CMSContext.CurrentUser.IsAuthorizedPerResource("CMS.Groups", CMSAdminControl.PERMISSION_MANAGE)) { RedirectToCMSDeskAccessDenied("CMS.Groups", CMSAdminControl.PERMISSION_MANAGE); } if (gi != null) { try { GroupInfoProvider.DeleteGroupInfo(gi, chkDeleteAll.Checked); } catch (Exception ex) { ShowError(ex.Message, EventLogProvider.GetExceptionLogMessage(ex), null); return; } } URLHelper.Redirect(mGroupListUrl); }