Esempio n. 1
0
 public void RemoveResourceSecurityInformation(string cluster, string resource)
 {
     lock (_store)
     {
         //JsonSerializer<IResourceItem> serializer = new JsonSerializer<IResourceItem>();
         ICollectionStore      collection    = ((SystemDatabaseStore)_store).Collections[Alachisoft.NosDB.Core.Util.MiscUtil.SystemCollection.SecurityInformationCollection];
         IList <IJSONDocument> jsonDocuments = new List <IJSONDocument>();
         JSONDocument          doc           = new JSONDocument();
         bool found = false;
         if (resource != null)
         {
             doc.Key = resource;
             found   = FindDocument(resource, Alachisoft.NosDB.Core.Util.MiscUtil.SystemCollection.SecurityInformationCollection, out doc);
             if (found)
             {
                 IDocumentsWriteOperation deleteOperation = new DeleteDocumentsOperation();
                 deleteOperation.Collection = Alachisoft.NosDB.Core.Util.MiscUtil.SystemCollection.SecurityInformationCollection;
                 deleteOperation.Database   = MiscUtil.SYSTEM_DATABASE;
                 jsonDocuments.Add(doc);
                 deleteOperation.Documents = jsonDocuments;
                 _store.DeleteDocuments(deleteOperation);
             }
         }
     }
 }