boolean checkPermission(Permission p, Epoch e) { return checkCache(p,e); }
public boolean checkPermission() { boolean granted = false; if (permissionCache != null) { granted = permissionCache.checkPermission(this.permission,this.epoch); } return granted; }
public static synchronized PermissionCache removePermissionCache(PermissionCache cache) { PermissionCache rvalue = null; if (cache != null) { Object value = cacheMap.remove(cache.getFactoryKey()); if (value != null && value instanceof PermissionCache) { rvalue = (PermissionCache) value; rvalue.reset(); } } return rvalue; }
return checkLoadedCache(p,e); return checkLoadedCache(p,e); } finally { rLock.unlock(); try { if (setPc) { setPolicyContextID(this.pcID); if (setPc) { try { setPolicyContextID(oldpcID); } catch(Exception ex) { _logger.log(Level.SEVERE,"JACC: Unexpected security exception on access decision", ex); resolvePermissions(pc,p); return checkLoadedCache(p,e); } finally { rLock.unlock();
private static synchronized PermissionCache createSecurityManagerCache() { Integer key = getNextKey(); PermissionCache cache = new PermissionCache(key, null, null, protoPerms, null); return registerPermissionCache(cache); }
/** * This resets all caches inside the factory. */ public static synchronized void resetCaches() { supportsReuse = true; java.lang.SecurityManager sm = System.getSecurityManager(); if (sm != null && sm instanceof J2EESecurityManager) { if (!((J2EESecurityManager)sm).cacheEnabled()) { ((J2EESecurityManager)sm).enablePermissionCache (securityManagerCache); } } Iterator iter = cacheMap.values().iterator(); while (iter.hasNext()) { Object cache = iter.next(); if (cache instanceof PermissionCache) { ((PermissionCache) cache).reset(); } } } }
/** * Register a PermissionCache object with the factory. If an object is * already registered at the key, it will be overidden. * @param cache a cache with an internal key value. * @return the cache object */ private static PermissionCache registerPermissionCache(PermissionCache cache) { cacheMap.put(cache.getFactoryKey(),cache); return cache; }
new PermissionCache(key, pcID, codesource, clazz, name);
uncheckedPermissionCache.reset();
public boolean permitAll(HttpServletRequest req) { boolean ret = false; WebResourcePermission webResPerm = createWebResourcePermission(req); if (uncheckedPermissionCache != null) { ret = uncheckedPermissionCache.checkPermission(webResPerm); } if (ret == false) { ret = checkPermissionWithoutCache(webResPerm, null); } return ret; }
new PermissionCache(key, pcID, codesource, perms, name);
public boolean checkPermission(Permission p) { return checkCache(p,null); }
private boolean checkProperty(String key) { if(key.equals("javax.net.ssl.keyStorePassword") || key.equals("javax.net.ssl.trustStorePassword")){ SSLUtils.checkPermission(key); } if (cacheEnabled()) { return cache.checkPermission(new PropertyPermission(key, "read")); } return false; }
protected boolean checkPermission(Permission perm, Set principalSet) { boolean ret = false; if (uncheckedPermissionCache != null) { ret = uncheckedPermissionCache.checkPermission(perm); } if (ret == false) { ret = checkPermissionWithoutCache(perm, principalSet); } else { try { setPolicyContext(CONTEXT_ID); } catch(Throwable t){ if (logger.isLoggable(Level.FINE)){ logger.log(Level.FINE, "[Web-Security] Web Permission Access Denied.",t); } ret = false; } } return ret; }