private bool DeleteConfigSection(IPermissionActor target) { IConfigurationElement config = target is IPermissionGroup ? GroupsConfig["Groups"] : PlayersConfig[((IUser)target).UserType]; List <PermissionSection> values = config.Get <PermissionSection[]>().ToList(); int i = values.RemoveAll(c => c.Id.Equals(target.Id, StringComparison.OrdinalIgnoreCase)); config.Set(values); return(i > 0); }