Error 321 on Updating System ACL

Error 321 on Updating System ACL

Anonymous
Not applicable
378 Views
1 Reply
Message 1 of 2

Error 321 on Updating System ACL

Anonymous
Not applicable

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!!

 

0 Likes
379 Views
1 Reply
Reply (1)
Message 2 of 2

sajith_subramanian
Autodesk Support
Autodesk Support

Hi @Anonymous ,

 

The description of error 321 says this: WorkgroupDoesNotHaveAdminOwnership.

If you are facing this issue only through the API, there is a similar post on a related topic. Please take a look at it, if you haven't already. Please find link below:

 

https://forums.autodesk.com/t5/vault-customization/error-321-when-changing-security-in-replicated-environment/td-p/5430000

 

Regards,

Sajith

 

 


Sajith Subramanian
Autodesk Developer Network
0 Likes