Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
import jenkins.security.admin.*;
import jenkins.security.s2m.AdminWhitelistRule;

String op = "readwrite"; // or any other operation like "read"
File f = new File("/path/you/want/to/testuserContent/some-path");
Jenkins.instance.injector.getInstance(AdminWhitelistRule.class).checkFileAccess(op,f)
// true means whitelisted. false or SecurityException means rejected

...