public class ComposableSecurityManagerPolicy extends Policy
Policy.Parameters| Modifier and Type | Field and Description |
|---|---|
static PermissionCollection |
allPermissions |
UNSUPPORTED_EMPTY_COLLECTION| Constructor and Description |
|---|
ComposableSecurityManagerPolicy(SecurityManager originalManager,
Policy originalPolicy) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkRead(Collection<io.takari.builder.enforcer.CachingPolicy> policies,
String fileName) |
protected void |
checkWrite(Collection<io.takari.builder.enforcer.CachingPolicy> policies,
String fileName) |
static Policy |
getContextPolicy(Object key) |
PermissionCollection |
getPermissions(CodeSource domain) |
PermissionCollection |
getPermissions(ProtectionDomain domain) |
boolean |
implies(ProtectionDomain protectionDomain,
Permission permission)
The key to using a Policy rather than a modified security manager is that a Policy will not be
called when the jvm code (which does not have a protection domain associated with it) executes
command to get system properties of spawns threads for itself.
|
static void |
registerContextPolicy(Object key,
Policy policy) |
static ComposableSecurityManagerPolicy |
removeSystemSecurityManager() |
static void |
setDefaultPolicy(Policy policy) |
static ComposableSecurityManagerPolicy |
setSystemSecurityManager() |
static Policy |
unregisterContextPolicy(Object key) |
getInstance, getInstance, getInstance, getParameters, getPolicy, getProvider, getType, refresh, setPolicypublic static final PermissionCollection allPermissions
public ComposableSecurityManagerPolicy(SecurityManager originalManager, Policy originalPolicy)
public boolean implies(ProtectionDomain protectionDomain, Permission permission)
allPermissions when
getPermissions(ProtectionDomain) is called with a protection domain we don't want to
interfere with.protected void checkWrite(Collection<io.takari.builder.enforcer.CachingPolicy> policies, String fileName)
protected void checkRead(Collection<io.takari.builder.enforcer.CachingPolicy> policies, String fileName)
public PermissionCollection getPermissions(ProtectionDomain domain)
getPermissions in class Policypublic PermissionCollection getPermissions(CodeSource domain)
getPermissions in class Policypublic static void setDefaultPolicy(Policy policy)
public static ComposableSecurityManagerPolicy setSystemSecurityManager()
public static ComposableSecurityManagerPolicy removeSystemSecurityManager()
Copyright © 2017. All rights reserved.