gpt4 book ai didi

java - 更改分配给 Documentum 中 ACL 的组的 r_accessor_permit

转载 作者:行者123 更新时间:2023-12-01 09:16:44 26 4
gpt4 key购买 nike

我想使用 DFC 来更改分配给 acl 的组的 r_accessor_permit 值:

1 -> 首先我选择了一个名为“fme”的 ACL

2 -> 然后我编写了以下 DQL 以获得分配给它的组:

select r_accossor_name from dm_acl where object_name = 'fme'

3 -> 我收到了一份群组列表,我复制粘贴了其中一个名为:grp_corp_lgl_sateri_hk

然后我写了以下内容:

public void changeGroupPermission (){
try{
String myAcl = "fme";
IDfACL acl = (IDfACL)_session.newObject("dm_acl");
acl.setString("object_name", myAcl);

acl.revoke("grp_corp_lgl_sateri_hk","execute_proc");
acl.save();
}catch(Exception E){
System.out.println(E.getLocalizedMessage());
}
}

我运行它,结果出现以下错误:

[DM_ACL_E_NOMATCH]error: "No ACEs matched for the name 'grp_corp_lgl_sateri_hk' in the ACL 'fme'."

我很确定我没有犯任何打字错误。但我找不到我面临这种错误的原因。知道我在哪里犯了错误吗?

===> 更新问题在我根据评论意识到我的错误之后,我再次尝试如下:

    try{
String aclName = "fme";
IDfACL acl = _session.getACL(aclName, "LEXOPEDIA");
acl.destroy();
//or
acl.revoke("grp_sateri_prc_lgl_acc2", "change_location");
acl.save();
}catch(Exception E){
E.printStackTrace();
}

但我仍然不断收到错误,我真的知道为什么吗?任何想法 ?

最佳答案

当您认为从存储库检索 ACL 是使用 IDfSession.newObject(<type_name>) 完成时,您犯了错误方法。此方法用于在存储库中创建新对象。相反,你应该这样做:

IDfACL acl = sess.getObjectByQualification("dm_acl where object_name='" + myAcl + "'");
acl.revoke("grp_corp_lgl_sateri_hk","execute_proc");
acl.save();

IDfACL acl = sess.getACL(myACL, <your ACL's domain name>); 
// domain name could be "DM_DBO" if your ACL is available for everyone in repository
acl.revoke("grp_corp_lgl_sateri_hk","execute_proc");
acl.save();

自从您创建了新对象以来,您此时没有名称为 grp_corp_lgl_sateri_hk 的访问器是合乎逻辑的。 。

关于java - 更改分配给 Documentum 中 ACL 的组的 r_accessor_permit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40499653/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com