framework.checkAdminPermission(framework.systemBundle, AdminPermission.PERMISSION);
SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new AllPermission());
	public void setPermissions(String location, PermissionInfo[] permissions) {		framework.checkAdminPermission(framework.systemBundle, AdminPermission.PERMISSION);		if (location == null) {			throw new NullPointerException();		}		PermissionStorage storage = new org.eclipse.osgi.framework.internal.core.SecurePermissionStorage(this.storage);		try {			String[] data = makePermissionData(permissions);			if (Debug.DEBUG && Debug.DEBUG_SECURITY) {				Debug.println("Setting permissions for location: " + location); //$NON-NLS-1$				if (data == null) {					Debug.println("  <none>"); //$NON-NLS-1$				} else {					for (int i = 0; i < data.length; i++) {						Debug.println("  " + data[i]); //$NON-NLS-1$					}				}			}			storage.setPermissionData(location, data);		} catch (IOException e) {			framework.publishFrameworkEvent(FrameworkEvent.ERROR, framework.systemBundle, e);			return;		}		AbstractBundle bundle = framework.getBundleByLocation(location);		if ((bundle != null) && (bundle.getBundleId() != 0)) {			ProtectionDomain domain = bundle.getProtectionDomain();			if (domain != null) {				BundleCombinedPermissions combined = (BundleCombinedPermissions) domain.getPermissions();				if (permissions == null) {					combined.setAssignedPermissions(defaultAssignedPermissions, true);				} else {					combined.setAssignedPermissions(createPermissions(permissions, bundle), false);				}			}		}	}