final AllPermission allPermission = new AllPermission();
final HashMap grants = new HashMap();
grants.put( codeSource, new Permission[]{allPermission} );
final Policy policy = new DefaultPolicy( grants );
policy.refresh();
final PermissionCollection resultPermissions = policy.getPermissions( codeSource );
final Enumeration enumeration = resultPermissions.elements();
while( enumeration.hasMoreElements() )
{
final Permission permission = (Permission)enumeration.nextElement();