Hello Everyone,
I was trying to dynamically change the permission of a document(who can access a document and at what level) and I was able to make it work using this code.
Dim oACL : Set oACL = Vault.ObjectOperations.GetObjectPermissions(ObjVer).AccessControlList
oACL.CustomComponent.AccessControlEntries.ResetCurrentUserBinding()
acekAddressee.SetUserOrGroupID getPropertyValue(1131, 1), false ' true -> this is a group ID, not an individual user ID
oACL.CustomComponent.AccessControlEntries.Add acekAddressee, acedEdit
if(cc.Count <> 0) then
Dim pos: pos = 0
For Each c in cc
Dim temp
pos = pos + 1
if(c.DisplayID <> addressee) then
temp = getPropertyValue(1176, pos)
Dim nACEKeyX : Set nACEKeyX = CreateObject("MFilesAPI.AccessControlEntryKey")
nACEKeyX.SetUserOrGroupID temp, false
oACL.CustomComponent.AccessControlEntries.Add nACEKeyX, acedRead
end if
Next
End if
Vault.ObjectOperations.ChangePermissionsToACL ObjVer, oACL, True
Now, What I want to do is before I add an entry in ACL I want to remove the existing entries in ACL (Reset the ACL). Is this possible?
I attached an image showing what i want to do.
