Versions Compared

Key

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

...

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