0

I am doing a java project connected to Documentum data storage . I am trying to create an ACL manually using the API class . The following is my code :

            StringBuilder newAcl = new StringBuilder();
            newAcl.append(selectedItem.getName());
            newAcl.append(selectedItem.getId());
            newAcl.append("_acl");
            IDfACL acl = (IDfACL)_session.newObject("dm_acl");

            acl.setObjectName(newAcl.toString());
            acl.setDescription(newAcl.toString());

            acl.save();

            IDfPermit permit = new DfPermit();

            permit.setAccessorName(newAcl.toString());
            permit.setPermitType(IDfPermit.DF_ACCESS_PERMIT);
            permit.setPermitValue(IDfACL.DF_XPERMIT_CHANGE_FOLDER_LINKS_STR);
            permit.setPermitValue(IDfACL.DF_PERMIT_READ_STR);
            acl.grantPermit(permit);

            acl.save();

The thing is I can successully create the ACL I'm trying to create and it's retrievable from dm_acl table object . The only thing that I've stucked at is how to set the owner as I have never specified that in my code and once I check the dm_acl table it says that the owner is dm_admin . Any idea how can I fix that ? Beside although I can create the ACL successfully in dm_acl but I get an error as well saying :

[DM_ACL_E_USER_NOT_EXIST]error: "The owner_name or accessor_name 'China InvestmentsCIL_acl' given in the ACL 'China InvestmentsCIL_acl' does not exist."

Miki
  • 2,493
  • 2
  • 27
  • 39
Danial Kosarifa
  • 1,044
  • 4
  • 18
  • 51

2 Answers2

0

The [DM_ACL_E_USER_NOT_EXIST] error you are facing is probably because in some point of time you had that owner / group when you created your ACL and in meanwhile somehow it was deleted. Now when you are updating your dm_acl object you are facing this.

Miki
  • 2,493
  • 2
  • 27
  • 39
0

The problem is that in your code you are not defining ACL accessor correctly. From the message you can see that you are tying to set the name of the ACL as a the name of the accessor.

permit.setAccessorName(newAcl.toString());

And it should be the name of an existing user/group for which you are setting permissions.

Milan
  • 1,903
  • 17
  • 16