access control延迟锁门_如何在ACM客户端中临时挂起访问控制(AccessControl)的方案...

如何在ACM客户端中临时挂起访问控制(AccessControl)的方案:

可以使用SessionServerHelper.manager对象,它是一个SessionManagerSvr接口的实现。

它会临时关闭对AccessControl的验证通道(基于单个MethodContext,或者说是当前线程下),从而绕过在访问ACM服务端资源(如WTDocument,EPMDocument等)时的权限要求。

以下是SessionManagerSvr接口方法setAccessEnforced的javadoc描述:

setAccessEnforced

boolean setAccessEnforced(boolean enforce)

Suspends or resumes all access & authorization enforcement. If the argument is false then access/authorization enforcement is suspended; otherwise it is resumed. The method returns true if the access/authorization checks are being enforced or false otherwise.

This method can be used to temporarily suspend access/authorization enforcement using a try/finally block, in which the enforcement is suspended in the try block and restored in the finally block. The return value can be used to restore the value to whatever it was before the enforcement was suspended.

我们可以在try段中通过setAccessEnforced(false),然后在finally段中再把setAccessEnforced(true)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值