private boolean doImplies(ProtectionDomain domain, Permission permission) { String contextId = PolicyContext.getContextID(); PolicyConfigurationImpl pci = getPolicyConfigForContext(contextId); Policy appPolicy = getPolicy(pci);
private boolean doImplies(ProtectionDomain domain, Permission permission) { String contextId = PolicyContext.getContextID(); PolicyConfigurationImpl pci = getPolicyConfigForContext(contextId); Policy appPolicy = getPolicy(pci);
/** * Evaluates the global policy and returns a * PermissionCollection object specifying the set of * permissions allowed for code from the specified * code source. * * @param codesource the CodeSource associated with the caller. * This encapsulates the original location of the code (where the code * came from) and the public key(s) of its signer. * * @return the set of permissions allowed for code from <i>codesource</i> * according to the policy.The returned set of permissions must be * a new mutable instance and it must support heterogeneous * Permission types. * */ public PermissionCollection getPermissions(CodeSource codesource) { String contextId = PolicyContext.getContextID(); PolicyConfigurationImpl pci = getPolicyConfigForContext(contextId); Policy appPolicy = getPolicy(pci); PermissionCollection perms = appPolicy.getPermissions(codesource); if (perms != null) { perms = removeExcludedPermissions(pci,perms); } if (logger.isLoggable(Level.FINEST)){ logger.finest("JACC Policy Provider: PolicyWrapper.getPermissions(cs), context ("+contextId+") codesource ("+codesource+") permissions: "+perms); } return perms; }
/** * Evaluates the global policy and returns a * PermissionCollection object specifying the set of * permissions allowed for code from the specified * code source. * * @param codesource the CodeSource associated with the caller. * This encapsulates the original location of the code (where the code * came from) and the public key(s) of its signer. * * @return the set of permissions allowed for code from <i>codesource</i> * according to the policy.The returned set of permissions must be * a new mutable instance and it must support heterogeneous * Permission types. * */ public PermissionCollection getPermissions(CodeSource codesource) { String contextId = PolicyContext.getContextID(); PolicyConfigurationImpl pci = getPolicyConfigForContext(contextId); Policy appPolicy = getPolicy(pci); PermissionCollection perms = appPolicy.getPermissions(codesource); if (perms != null) { perms = removeExcludedPermissions(pci,perms); } if (logger.isLoggable(Level.FINEST)){ logger.finest("JACC Policy Provider: PolicyWrapper.getPermissions(cs), context ("+contextId+") codesource ("+codesource+") permissions: "+perms); } return perms; }
PolicyConfigurationImpl pci = getPolicyConfigForContext(contextId); Policy appPolicy = getPolicy(pci); PermissionCollection perms = appPolicy.getPermissions(domain);
PolicyConfigurationImpl pci = getPolicyConfigForContext(contextId); Policy appPolicy = getPolicy(pci); PermissionCollection perms = appPolicy.getPermissions(domain);