Versions Compared

Key

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

...

Artifacts will check permissions in two steps: #Get

  1. Get an AccessController instance from Security by calling the getUserPermissions method

...

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