public static void CreateNewDocumentWithNewACL()
        {
            LogIntoVault();

            //Prerequisites for creating an object in mfiles;
            //Type of object E.g. 0 is for document
            //PropertyValues
            //Source files if the object's type is document or any other type that can have documents

            var properties = new PropertyValues();

            //Class 0 -> Sınıflandırılmamış Doküman
            var classProperty = new PropertyValue();

            classProperty.PropertyDef = (int)MFBuiltInPropertyDef.MFBuiltInPropertyDefClass; //Simply 100
            classProperty.TypedValue.SetValue(MFDataType.MFDatatypeLookup, 0);
            properties.Add(0, classProperty);

            //Name or Title -> İsim veya başlık
            var nameProperty = new PropertyValue();

            nameProperty.PropertyDef = (int)MFBuiltInPropertyDef.MFBuiltInPropertyDefNameOrTitle; //Simply 0
            nameProperty.TypedValue.SetValue(MFDataType.MFDatatypeText, "SampleTextFile");
            properties.Add(0, nameProperty);

            //File from fileSystem
            var sourceObjectFile = new SourceObjectFile();

            sourceObjectFile.Title          = "SampleTextFile";
            sourceObjectFile.SourceFilePath = "SampleTextFile.txt";
            sourceObjectFile.Extension      = "txt";


            //Create New ACL
            var accessControlList = new AccessControlList();

            accessControlList.IsFullyAuthoritative = true;

            //Create Component
            var aclComponent = new AccessControlListComponent();


            //Create Entry
            var aclEntryKey = new AccessControlEntryKey();

            aclEntryKey.SetUserOrGroupID(1, true);

            //Create Data (Permissions for Entry)
            var aclData = new AccessControlEntryData();

            aclData.DeletePermission            = MFPermission.MFPermissionNotSet;
            aclData.ReadPermission              = MFPermission.MFPermissionAllow;
            aclData.EditPermission              = MFPermission.MFPermissionNotSet;
            aclData.AttachObjectsPermission     = MFPermission.MFPermissionAllow;
            aclData.ChangePermissionsPermission = MFPermission.MFPermissionNotSet;

            //Set Entry Key, Data
            aclComponent.AccessControlEntries.Add(aclEntryKey, aclData);

            //Add to ACL
            accessControlList.CustomComponent = aclComponent;

            var namedACLAdmin = new NamedACLAdmin();
            var namedACL      = new NamedACL();

            namedACL.AccessControlList = accessControlList;
            namedACL.Name = "NewACL" + Guid.NewGuid().ToString().Substring(7);

            namedACLAdmin.NamedACL = namedACL;

            //Add ACL TO Server
            var newCreatedACL = loggedInVault.NamedACLOperations.AddNamedACLAdmin(namedACLAdmin);

            //Use newly Added ACL
            loggedInVault.ObjectOperations.CreateNewSFDObject(
                0
                , properties
                , sourceObjectFile
                , true
                , newCreatedACL.NamedACL.AccessControlList);
        }
Example #2
0
 public void Remove(AccessControlEntryKey AccessControlEntryKey)
 {
     throw new NotImplementedException();
 }
Example #3
0
 public AccessControlEntryData At(AccessControlEntryKey AccessControlEntryKey)
 {
     throw new NotImplementedException();
 }
Example #4
0
 public bool HasKey(AccessControlEntryKey AccessControlEntryKey)
 {
     throw new NotImplementedException();
 }
Example #5
0
 public void Add(AccessControlEntryKey AccessControlEntryKey, AccessControlEntryData AccessControlEntryData)
 {
     throw new NotImplementedException();
 }