4

Is it possible to grant same permissions to unrelated codebases (e.g. I can not use wildcards)?

For example I have following permission configuration:

grant codebase "file:/somepath1/code.jar" {
  permission my.class.Permission1;
  permission my.class.Permission2;
  permission my.class.Permission3;
};

I want to grant the same permission set also to /somepath2/code2.jar and to path3/code3.jar.

Is it possible to do with single grant section?

starball
  • 20,030
  • 7
  • 43
  • 238
michael nesterenko
  • 14,222
  • 25
  • 114
  • 182

1 Answers1

2

From what I know there are 2 ways to achieve what you wish:
1.sing you jars with some certificate and then use:

grant signedBy "Duke" {
       permission my.class.Paermission1;
}; 

"Duke" is an alias to certificate in tye keystore.

2.reorganize you jars into folders and then use:

grant codeBase "file:/somepath/subpath1/-" {
      permission my.class.Paermission1;
};

"/-" matches all files (both class and JAR files) in the directory and recursively all files in subdirectories contained in that directory

Check this for details PolicyFiles

Tomasz Krzyżak
  • 1,087
  • 8
  • 10