use of java.security.PermissionCollection in project Payara by payara.
the class EarEEPermissionsProcessor method convertEEPermissionPaths.
// conver the path for permissions
private void convertEEPermissionPaths(CommponentType cmpType) throws MalformedURLException {
// get server suppled default policy
PermissionCollection defWarPc = SMGlobalPolicyUtil.getEECompGrantededPerms(cmpType);
// revise the filepermission's path
PermissionCollection eePc = processPermisssonsForPath(defWarPc, context);
if (logger.isLoggable(Level.FINE)) {
logger.fine("Revised permissions = " + eePc);
}
compTypeToEEGarntsMap.put(cmpType, eePc);
}
use of java.security.PermissionCollection in project Payara by payara.
the class SMGlobalPolicyUtil method checkRestrictionOfEar.
// for ear type, check evrything
public static void checkRestrictionOfEar(PermissionCollection declaredPC) throws SecurityException {
PermissionCollection pc = compTypeToEERestrictedMap.get(CommponentType.ejb);
if (pc != null)
SMGlobalPolicyUtil.checkRestriction(declaredPC, pc);
pc = compTypeToEERestrictedMap.get(CommponentType.war);
if (pc != null)
SMGlobalPolicyUtil.checkRestriction(declaredPC, pc);
pc = compTypeToEERestrictedMap.get(CommponentType.rar);
if (pc != null)
SMGlobalPolicyUtil.checkRestriction(declaredPC, pc);
pc = compTypeToEERestrictedMap.get(CommponentType.car);
if (pc != null)
SMGlobalPolicyUtil.checkRestriction(declaredPC, pc);
}
use of java.security.PermissionCollection in project Payara by payara.
the class SMGlobalPolicyUtil method checkRestrictionOfComponentType.
/**
* Check a permission set against a restriction of a component type
*
* @param declaredPC
* @param type
* @return
* @throws SecurityException
*/
public static void checkRestrictionOfComponentType(PermissionCollection declaredPC, CommponentType type) throws SecurityException {
if (CommponentType.ear == type)
checkRestrictionOfEar(declaredPC);
PermissionCollection restrictedPC = compTypeToEERestrictedMap.get(type);
checkRestriction(declaredPC, restrictedPC);
}
use of java.security.PermissionCollection in project Payara by payara.
the class PermsArchiveDelegate method processEEPermissions.
/**
* Get the EE permissions for the spcified module type
*
* @param type module type
* @param dc the deployment context
* @return the ee permissions
*/
public static PermissionCollection processEEPermissions(SMGlobalPolicyUtil.CommponentType type, DeploymentContext dc) {
ModuleEEPermissionsProcessor eePp = new ModuleEEPermissionsProcessor(type, dc);
PermissionCollection eePc = eePp.getAdjustedEEPermission();
return eePc;
}
use of java.security.PermissionCollection in project Payara by payara.
the class PermsArchiveDelegate method processModuleDeclaredAndEEPemirssions.
/**
* Get the declared permissions and EE permissions, then add them to the classloader
*
* @param type module type
* @param context deployment context
* @param classloader throws AccessControlException if caller has no privilege
*/
public static void processModuleDeclaredAndEEPemirssions(SMGlobalPolicyUtil.CommponentType type, DeploymentContext context, ClassLoader classloader) throws SecurityException {
if (System.getSecurityManager() != null) {
if (!(classloader instanceof DDPermissionsLoader))
return;
if (!(context instanceof ExtendedDeploymentContext))
return;
DDPermissionsLoader ddcl = (DDPermissionsLoader) classloader;
if (((ExtendedDeploymentContext) context).getParentContext() == null) {
PermissionCollection declPc = getDeclaredPermissions(type, context);
ddcl.addDeclaredPermissions(declPc);
}
PermissionCollection eePc = processEEPermissions(type, context);
ddcl.addEEPermissions(eePc);
}
}
Aggregations