use of javax.management.MBeanPermission in project Payara by payara.
the class BasePolicyWrapper method doImplies.
private boolean doImplies(ProtectionDomain domain, Permission permission) {
String contextId = PolicyContext.getContextID();
PolicyConfigurationImpl pci = getPolicyConfigForContext(contextId);
Policy appPolicy = getPolicy(pci);
boolean result = appPolicy.implies(domain, permission);
// login pages, and javax.management.MBeanPermission
if (!result) {
if (!(permission instanceof WebResourcePermission) && !(permission instanceof MBeanPermission) && !(permission instanceof WebRoleRefPermission) && !(permission instanceof EJBRoleRefPermission)) {
final String contextId2 = contextId;
final Permission permission2 = permission;
final ProtectionDomain domain2 = domain;
if (logger.isLoggable(Level.FINE)) {
Exception ex = new Exception();
ex.fillInStackTrace();
logger.log(Level.FINE, "JACC Policy Provider, failed Permission Check at :", ex);
}
AccessController.doPrivileged(new PrivilegedAction() {
@Override
public Object run() {
logger.info("JACC Policy Provider: Failed Permission Check, context(" + contextId2 + ")- permission(" + permission2 + ")");
if (logger.isLoggable(Level.FINE)) {
logger.fine("Domain that failed(" + domain2 + ")");
}
return null;
}
});
}
} else {
Permissions excluded = getExcludedPolicy(pci);
if (excluded != null) {
result = !grantedIsExcluded(permission, excluded);
}
}
// at FINEST: log only denies
if (!result && logger.isLoggable(Level.FINEST)) {
logger.finest("JACC Policy Provider: PolicyWrapper.implies, context (" + contextId + ")- result was(" + result + ") permission (" + permission + ")");
}
return result;
}
use of javax.management.MBeanPermission in project jdk8u_jdk by JetBrains.
the class ClassLoaderRepositorySupport method getClassLoader.
public final ClassLoader getClassLoader(ObjectName name) {
ClassLoader instance = loadersWithNames.get(name);
if (instance != null) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
Permission perm = new MBeanPermission(instance.getClass().getName(), null, name, "getClassLoader");
sm.checkPermission(perm);
}
}
return instance;
}
use of javax.management.MBeanPermission in project jdk8u_jdk by JetBrains.
the class MBeanInstantiator method checkMBeanPermission.
private static void checkMBeanPermission(String classname, String member, ObjectName objectName, String actions) throws SecurityException {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
Permission perm = new MBeanPermission(classname, member, objectName, actions);
sm.checkPermission(perm);
}
}
use of javax.management.MBeanPermission in project wildfly by wildfly.
the class ServiceMBeanSupportOrderingTestCase method geTestMBeanSar.
@Deployment(name = ServiceMBeanSupportOrderingTestCase.UNMANAGED_SAR_DEPLOYMENT_NAME, managed = false)
public static JavaArchive geTestMBeanSar() {
final JavaArchive sar = ShrinkWrap.create(JavaArchive.class, "service-mbean-order-test.sar");
sar.addClasses(LifecycleEmitterMBean.class, LifecycleEmitter.class);
sar.addAsManifestResource(ServiceMBeanSupportOrderingTestCase.class.getPackage(), "jboss-service.xml", "jboss-service.xml");
sar.addAsManifestResource(createPermissionsXmlAsset(new MBeanPermission(ServiceMBeanSupportOrderingTestCase.class.getPackage().getName() + ".*", "*")), "permissions.xml");
return sar;
}
Aggregations