1 26 27 package com.opensugar.cube.simple; 28 29 import com.opensugar.cube.AbstractCube; 30 import com.opensugar.cube.BundleImpl; 31 import com.opensugar.cube.BundleClassLoader; 32 import com.opensugar.cube.NamedPropertySet; 33 34 import org.osgi.framework.Bundle; 35 import org.osgi.framework.BundleException; 36 37 import java.io.File ; 38 import java.io.IOException ; 39 40 public class CubeWithoutPermissions extends AbstractCube { 43 44 public CubeWithoutPermissions() { 45 this( null ); 46 } 47 48 public CubeWithoutPermissions( File baseDirectory ) { 49 super( baseDirectory ); 50 log( LOG_INFO, "Permissions not supported" ); 51 } 52 53 protected boolean enforcesPermissions() { 54 return false; 55 } 56 57 public void checkAdminPermission() { 58 } 59 60 public void checkFilePermission( String file, String permissionToCheck ) { 61 } 62 63 public void checkPackagePermission( NamedPropertySet[] packages, String permissionToCheck, Object codeSource ) { 64 } 65 66 public void checkPropertyPermission( String property, String permissionToCheck ) { 67 } 68 69 public void checkServicePermission( String className, String permissionToCheck ) { 70 } 71 72 public void checkServicePermissionForAll( String [] classNames, String permissionToCheck ) { 73 } 74 75 public void checkServicePermissionForAtLeastOne( String [] classNames, String permissionToCheck ) { 76 } 77 78 protected boolean hasPermission( BundleImpl bundle, Object permission ) { 79 return true; 80 } 81 82 protected BundleClassLoader createClassLoaderForBundle( BundleImpl bundle, File bundleJarFile, NamedPropertySet[] nativeLibraries, NamedPropertySet[] classPath ) throws IOException { 83 return SimpleBundleClassLoader.createClassLoader( bundle, bundleJarFile, nativeLibraries, classPath ); 84 } 85 86 } | Popular Tags |