SubjectDelegator.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:openjdk-jdk7u-jdk 作者:
/**
 * Check if the connector server creator can assume the identity of each
 * principal in the authenticated subject, i.e. check if the connector
 * server creator codebase contains a subject delegation permission for
 * each principal present in the authenticated subject.
 *
 * @return {@code true} if the connector server creator can delegate to all
 * the authenticated principals in the subject. Otherwise, {@code false}.
 */
public static synchronized boolean
    checkRemoveCallerContext(Subject subject) {
    try {
        final Principal[] dp =
            subject.getPrincipals().toArray(new Principal[0]);
        for (int i = 0 ; i < dp.length ; i++) {
            final String pname =
                dp[i].getClass().getName() + "." + dp[i].getName();
            final Permission sdp =
                new SubjectDelegationPermission(pname);
            AccessController.checkPermission(sdp);
        }
    } catch (SecurityException e) {
        return false;
    }
    return true;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号