protected void ButtonAddSelected_Click(object sender, EventArgs e) { if (ListEntries.SelectedIndex < 0) { return; } var acl = this.Acl.Entries.ToList(); var aceList = new List <SnAccessControlEntry>(); var index = 0; foreach (ListItem item in ListEntries.Items) { if (!item.Selected) { continue; } var propagates = CheckBoxLocalOnly == null ? true : !CheckBoxLocalOnly.Checked; var identityId = NodeHead.Get(item.Value).Id; var ace = SnAccessControlEntry.CreateEmpty(identityId, propagates); if (_customEntryIds != null && !_customEntryIds.Contains(identityId)) { _customEntryIds.Add(identityId); } // add to new entries aceList.Add(ace); // insert into the top of old entries acl.Insert(index++, ace); } this.Acl.Entries = acl; // clear this to refresh PermissionIds = null; this.Isi.AddToAceVisiblityList(aceList); RebuildEntryIdList(); // hide select panel this.Isi.Visible = false; RefreshAddEntryPanel(); RefreshListView(); }
protected void ButtonAddSelected_Click(object sender, EventArgs e) { if (ListEntries.SelectedIndex < 0) { return; } var acl = this.Acl.Entries.ToList(); var aceList = new List <SnAccessControlEntry>(); var index = 0; foreach (ListItem item in ListEntries.Items) { if (!item.Selected) { continue; } var node = Node.LoadNode(item.Value); var ace = SnAccessControlEntry.CreateEmpty(node.Id, true); //add to new entries aceList.Add(ace); //insert into the top of old entries acl.Insert(index++, ace); } this.Acl.Entries = acl; //clear this to refresh PermissionIds = null; this.Isi.AddToAceVisiblityList(aceList); RebuildEntryIdList(); //hide select panel this.Isi.Visible = false; RefreshAddEntryPanel(); RefreshListView(); }