/** * Try a permission check. Any violations will be logged to the {@code org.wildfly.security.access} category * at a {@code DEBUG} level. * * @param permission the permission to check * @param domains the protection domains to try * @return {@code true} if the access check succeeded, {@code false} otherwise */ public static boolean tryCheckPermission(final Permission permission, final ProtectionDomain... domains) { if (permission.implies(SECURITY_MANAGER_PERMISSION)) { return false; } final Context ctx = CTX.get(); if (ctx.checking) { if (ctx.entered) { return true; } ctx.entered = true; try { final ProtectionDomain deniedDomain = findAccessDenial(permission, domains); if (deniedDomain != null) { return false; } } finally { ctx.entered = false; } } return true; }
stack = getProtectionDomainStack(context); if (stack != null) { final ProtectionDomain deniedDomain = findAccessDenial(perm, stack); if (deniedDomain != null) { throw access.accessControlException(perm, perm, deniedDomain.getCodeSource(), deniedDomain.getClassLoader());
/** * Try a permission check. Any violations will be logged to the {@code org.wildfly.security.access} category * at a {@code DEBUG} level. * * @param permission the permission to check * @param domains the protection domains to try * @return {@code true} if the access check succeeded, {@code false} otherwise */ public static boolean tryCheckPermission(final Permission permission, final ProtectionDomain... domains) { if (permission.implies(SECURITY_MANAGER_PERMISSION)) { return false; } final Context ctx = CTX.get(); if (ctx.checking) { if (ctx.entered) { return true; } ctx.entered = true; try { final ProtectionDomain deniedDomain = findAccessDenial(permission, domains); if (deniedDomain != null) { return false; } } finally { ctx.entered = false; } } return true; }
/** * Try a permission check. Any violations will be logged to the {@code org.wildfly.security.access} category * at a {@code DEBUG} level. * * @param permission the permission to check * @param domains the protection domains to try * @return {@code true} if the access check succeeded, {@code false} otherwise */ public static boolean tryCheckPermission(final Permission permission, final ProtectionDomain... domains) { if (permission.implies(SECURITY_MANAGER_PERMISSION)) { return false; } final Context ctx = CTX.get(); if (ctx.checking) { if (ctx.entered) { return true; } ctx.entered = true; try { final ProtectionDomain deniedDomain = findAccessDenial(permission, domains); if (deniedDomain != null) { return false; } } finally { ctx.entered = false; } } return true; }
/** * Try a permission check. Any violations will be logged to the {@code org.wildfly.security.access} category * at a {@code DEBUG} level. * * @param permission the permission to check * @param domains the protection domains to try * @return {@code true} if the access check succeeded, {@code false} otherwise */ public static boolean tryCheckPermission(final Permission permission, final ProtectionDomain... domains) { if (permission.implies(SECURITY_MANAGER_PERMISSION)) { return false; } final Context ctx = CTX.get(); if (ctx.checking) { if (ctx.entered) { return true; } ctx.entered = true; try { final ProtectionDomain deniedDomain = findAccessDenial(permission, domains); if (deniedDomain != null) { return false; } } finally { ctx.entered = false; } } return true; }
final ProtectionDomain protectionDomain = findAccessDenial(permission, domains); if (protectionDomain != null) { final Context ctx = CTX.get();
stack = getProtectionDomainStack(context); if (stack != null) { final ProtectionDomain deniedDomain = findAccessDenial(perm, stack); if (deniedDomain != null) { throw access.accessControlException(perm, perm, deniedDomain.getCodeSource(), deniedDomain.getClassLoader());
stack = getProtectionDomainStack(context); if (stack != null) { final ProtectionDomain deniedDomain = findAccessDenial(perm, stack); if (deniedDomain != null) { throw access.accessControlException(perm, perm, deniedDomain.getCodeSource(), deniedDomain.getClassLoader());
stack = getProtectionDomainStack(context); if (stack != null) { final ProtectionDomain deniedDomain = findAccessDenial(perm, stack); if (deniedDomain != null) { throw access.accessControlException(perm, perm, deniedDomain.getCodeSource(), deniedDomain.getClassLoader());
stack = getProtectionDomainStack(context); if (stack != null) { final ProtectionDomain deniedDomain = findAccessDenial(perm, stack); if (deniedDomain != null) { final CodeSource codeSource = deniedDomain.getCodeSource();