Message 1 of 2
Error 321 on Updating System ACL

Not applicable
03-07-2019
09:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
My requirement is to change the workgroup to local workgroup. Then, give the user the permission to read, modify and delete the folder by updating the System ACL so that the user is able to delete the folder.
The piece of code that I am using is below:
wsm is WebServiceManager object ReplicationService rs = wsm.ReplicationService; Wkgrp workgrp=rs.GetLocalWorkgroup(); LongArray group = new LongArray(); group.Items = new long[] { fd.Id }; XferStatus[] status = rs.TransferEntityGroupOwnership(workgrp.Id, new LongArray[] { group }, 60); EntOwn[] owner_update=null; for (int i = 0; i < 12; i++) { owner_update = rs.GetOwnershipByEntityId(new long[] { fd.Id }); if (!owner_update[0].IsLocalOwn) System.Threading.Thread.Sleep(10000); else break; } if (!owner_update[0].IsLocalOwn) MessageBox.Show("Try again to Empty Trash Bin"); else { SecurityService securityService = wsm.SecurityService; AccessPermis[] update_permission = new AccessPermis[3]; AccessPermis newPermission; for(int i=0; i<3;i++) { newPermission = new AccessPermis(); newPermission.Id = Convert.ToInt64(i + 1); newPermission.Val = true; update_permission[i] = newPermission; } ACE update_ace= new ACE(); update_ace.UserGrpId = securityService.SecurityHeader.UserId; update_ace.PermisArray = update_permission; ACE[] entry = { update_ace }; ACL update_acl=securityService.UpdateSystemACL(fd.Id, entry,PrpgType.AppendPermissions,SysAclBeh.Override); wsm.DocumentService.DeleteFolderHierarchyUnconditional(fd.Id); }
On executing the code, I am getting error 321 on executing the line which I highlighted (bold and underlined line in the piece of code).
Kindly help me out.
Thanks!!