How to add permission to my jar in security.policy?

Here is a jar which named 'cat-client-1.4.0.jar' and I want to grant permissions for it:

grant codeBase "${}" {
  permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
  permission java.lang.RuntimePermission "*";
  permission "/data/applogs/cat", "write,read";
  permission "/data/appdatas/cat", "write,read";
  permission "/data/applogs/cat/*", "write,read";

but it doesn't work. There are other settings below which works

grant codeBase "${codebase.lucene-misc-6.2.1.jar}" {
  // needed to allow shard shrinking to use hard-links if possible via lucenes HardlinkCopyDirectoryWrapper
  permission java.nio.file.LinkPermission "hard";

I am wondering why my settings doesn't work?

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:


Did you read ?

I'm sorry for ignoring the rules. I have edited my questions.

Thanks. Much better.

Still, did you read ?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.