{
// We need to authorize java permissions.
// Without this check, we get a ClassCircularityError in Tomcat.
if (permission.getClass().getName().startsWith("java"))
{
perms.add(new AllPermission());
}
else
{
// if (log.isDebugEnabled())
// {
// log.debug("Implying permission [class, " + permission.getClass().getName() + "], " + "[name, "
// + permission.getName() + "], " + "[actions, " + permission.getActions() + "] for: ");
// log.debug("\tCodeSource:" + protectionDomain.getCodeSource().getLocation().getPath());
// for (int i = 0; i < principals.length; i++)
// {
// log.debug("\tPrincipal[" + i + "]: [name, " + principals[i].getName() + "], [class, "
// + principals[i].getClass() + "]");
// }
// }
perms = pms.getPermissions(Arrays.asList(principals));
}
}
else
{
// No principal is returned from the subject.
// For security check, be sure to use doAsPrivileged(theSubject, anAction, null)...
// We grant access when no principal is associated to the subject.
perms.add(new AllPermission());
}
if (null != perms)
{
permImplied = perms.implies(permission);
}