use of org.apache.derby.security.DatabasePermission in project derby by apache.
the class SystemPrivilegesPermissionTest method createDBPermNoCheck.
/**
* Create a DatabasePermission object without checking that the URL
* and the actions are valid.
*
* @param url the URL of the permission
* @param actions the actions of the permission
* @return a DatabasePermission instance
*/
private static DatabasePermission createDBPermNoCheck(String url, String actions) throws IOException {
// First create a valid permission object, so that the checks in
// the constructor are happy.
DatabasePermission perm = new DatabasePermission("directory:dir", "create");
// Then use reflection to override the values of the fields with
// potentially invalid values.
setField(Permission.class, "name", perm, url);
setField(DatabasePermission.class, "actions", perm, actions);
return perm;
}
Aggregations