// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // This is the policy file for JDO 1.0.2 assuming that // the JDO RI classes are in jar ${jdori}/src/jdori.jar, // the JDO classes are in jar ${jdori}/src/jdo.jar, // your application classes are in jar ${jdori}/src/test-classes.jar, and // your database files are in ${jdori}/src/test/database. grant codeBase "file:${jdori}/release/lib/ext/btree.jar" { // Allow btree classes to read the properties // org.netbeans.modules.mdr.btreestorage.*. permission java.util.PropertyPermission "org.netbeans.modules.mdr.btreestorage.*", "read"; // Allow btree classes to manage fostore database files. permission java.io.FilePermission "${jdori}${/}src${/}test${/}database${/}*", "read,write,delete"; }; grant codeBase "file:${jdori}/src/jdori.jar" { // Allow jdori classes to read system properties including // org.netbeans.modules.mdr.btreestorage.* // jdori-logger, user.home, status.verbose, maxInstances permission java.util.PropertyPermission "*", "read"; // Allow jdori classes to read the jdo.dtd from jdo.jar. permission java.io.FilePermission "${jdori}${/}src${/}jdo.jar", "read"; // Allow jdori classes to read the JDO metadata files. permission java.io.FilePermission "${jdori}${/}src${/}test${/}pcclasses.jar", "read"; // Allow jdori classes to read the directory where // fostore database files are located. permission java.io.FilePermission "${jdori}${/}src${/}test${/}database", "read"; // Allow jdori classes to manage fostore database files. permission java.io.FilePermission "${jdori}${/}src${/}test${/}database${/}*", "read,write,delete"; // Allow jdori classes to read the default file to specify jdori logger. permission java.io.FilePermission "${user.home}${/}.jdori-logger.properties", "read"; // Allow jdori classes to specify a stream handler // when constructing a fostore URL. permission java.net.NetPermission "specifyStreamHandler"; // Allow jdori classes to get metadata for persistence-capable classes. permission javax.jdo.spi.JDOPermission "getMetadata"; // Allow jdori classes to set the state manager for a // persistence-capable class instance. permission javax.jdo.spi.JDOPermission "setStateManager"; // Allow jdori classes to close the PersistenceManagerFactory permission javax.jdo.spi.JDOPermission "closePersistenceManagerFactory"; // Allow jdori classes to access declared members of a class // (e.g. a query accessing transient instances or non-managed fields). // The query component needs access to persistent fields. permission java.lang.RuntimePermission "accessDeclaredMembers"; // Allow jdori classes to access transient instances or non-managed // fields during a query. permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; // Allow jdori classes to get the class loader for a class. // This is necessary if the persistence-capable classes are loaded by // a different class loader from the jdori classes. permission java.lang.RuntimePermission "getClassLoader"; }; grant codeBase "file:${jdori}/src/jdo.jar" { // Allow jdo classes to get metadata for persistence-capable classes. permission javax.jdo.spi.JDOPermission "getMetadata"; // Allow jdo classes to manage metadata for persistence-capable classes. permission javax.jdo.spi.JDOPermission "manageMetadata"; // Allow jdo classes to set the state manager for a // persistence-capable class instance. permission javax.jdo.spi.JDOPermission "setStateManager"; }; grant codeBase "file:${jdori}/src/test/jdori-test.jar" { // Allow the test classes to read system properties. permission java.util.PropertyPermission "*", "read"; // Allow the query test to write a log file. permission java.io.FilePermission "Test_Query.log", "write"; // Allow the test classes to register a JVM shutdown hook. permission java.lang.RuntimePermission "shutdownHooks"; // Allow test classes to close the PersistenceManagerFactory permission javax.jdo.spi.JDOPermission "closePersistenceManagerFactory"; // Allow test classes to create a class loader permission java.lang.RuntimePermission "createClassLoader"; // Allow test classes to get a class loader permission java.lang.RuntimePermission "getClassLoader"; // Allow class loaders in test classes to read jar files permission java.io.FilePermission "${jdori}${/}src${/}test${/}pcclasses.jar", "read"; permission java.io.FilePermission "${jdori}${/}src${/}jdo.jar", "read"; // Allow test classes to get metadata for persistence-capable classes. permission javax.jdo.spi.JDOPermission "getMetadata"; // Allow test classes to manage metadata for persistence-capable classes. permission javax.jdo.spi.JDOPermission "manageMetadata"; }; grant codeBase "file:${jdori}/release/lib/ext/xerces.jar" { // Allow the xerces classes to read system properties. permission java.util.PropertyPermission "*", "read"; };