Versions Compared

Key

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

...

  1. Get an AccessController instance from Security the Authorization Manager by calling the getAccessController method
  2. Call the checkPermission method with the desired permission(s)
Code Block
java
java
    // An artifact update method
    public void doUpdateTask(ExecutionContext executionContext) throws AccessControlException {
        SecurityAuthorizationManager security = executionContext.getSecurity();
        AccessController accessController = security.getAccessController(executionContext);
        accessController.checkPermission(new UpdatePermission());
        ...
    }