3

We are using FileNet 5.1 and some other team has accidentally deleted a group say 'ABC' from prod. Now the documents who had 'ABC' applied are now having SID on them. We have now created a group with the same name & identified the affected GUIDs. I want to know how can I remove the SID on documents using Java Code? I already have a code to apply the newly created group 'ABC' on the affected documents. Please help

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
tiktok
  • 279
  • 2
  • 23

1 Answers1

4

After trying few things I made Java code to remove SID from documents and added newly created group on them. Here is the code:

Document document = Factory.Document.fetchInstance(<Object Store>, <Document ID>, null);
AccessPermissionList apl = document.get_Permissions();
Iterator ite = apl.iterator();
while (ite.hasNext()) {
    Permission permission = (Permission) ite.next();
    if (permission.get_GranteeName().equals(<SID goes here>)) {
        permission.set_GranteeName("Newly Created Group goes here");
        document.save(RefreshMode.REFRESH);
        break;
    }
}
SnareChops
  • 13,175
  • 9
  • 69
  • 91
tiktok
  • 279
  • 2
  • 23