Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

WorkflowLauncher and admin permissions in 6.4

davidpena_id
Level 1
Level 1

  I have a servlet that runs as admin and only admin.

Workflow launchers are now in /libs/settings/workflow/launcher/config and I have a servlet handles some work. It first turns off the launchers while it handles its business like so. This is a snippet:

public class MyServlet extends SlingAllMethodsServlet {

@Reference

WorkflowLauncher workflowLauncher;

@Override

protected void doPost(SlingHttpServletRequest request,
   SlingHttpServletResponse response) throws ServletException, IOException {

List<String> enabledWorkflowIds = new ArrayList<>();
List<ConfigEntry> configEntries = workflowLauncher.getConfigEntries();
for (ConfigEntry entry : configEntries) {

  if (entry.isEnabled()) {

  String id = entry.getId();
   enabledWorkflowIds.add(id);
   entry.setEnabled(false);

   try {

     workflowLauncher.editConfigEntry(id, entry);

    } catch (RepositoryException e) {

     e.printStackTrace();

   }

  }

}

response.getWriter().println("Turned off these workflow launchers: ");
response.getWriter().println(enabledWorkflowIds);

}

}

The servlet would go through and turn off all the workflow launchers and turn them off. This works on AEM 6.3 but not on AEM 6.4. Admin as far as I can tell has permission to edit those nodes. Any thoughts?

I'm getting this RepositoryException which says that admin doesn't have permission to disable the launchers:

16.11.2018 17:55:27.892 *WARN* [127.0.0.1 [1542419716436] POST /bin/project/myservlet HTTP/1.1] com.adobe.granite.workflow.core.launcher.WorkflowLauncherImpl Error editing launcher config entry

javax.jcr.AccessDeniedException: OakAccess0000: Access denied

at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:231) [org.apache.jackrabbit.oak-api:1.8.7]

at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:212) [org.apache.jackrabbit.oak-api:1.8.7]

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:670) [org.apache.jackrabbit.oak-jcr:1.8.7]

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:496) [org.apache.jackrabbit.oak-jcr:1.8.7]

at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.performVoid(SessionImpl.java:420) [org.apache.jackrabbit.oak-jcr:1.8.7]

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:274) [org.apache.jackrabbit.oak-jcr:1.8.7]

at org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:417) [org.apache.jackrabbit.oak-jcr:1.8.7]

... 136 omitted

Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakAccess0000: Access denied

at org.apache.jackrabbit.oak.security.authorization.permission.PermissionValidator.checkPermissions(PermissionValidator.java:240) [org.apache.jackrabbit.oak-core:1.8.7]

at org.apache.jackrabbit.oak.security.authorization.permission.PermissionValidator.propertyChanged(PermissionValidator.java:126) [org.apache.jackrabbit.oak-core:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.VisibleValidator.propertyChanged(VisibleValidator.java:92) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.propertyChanged(CompositeEditor.java:91) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.propertyChanged(EditorDiff.java:93) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareProperties(SegmentNodeState.java:632) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:526) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:423) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:619) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.MapRecord$4.childNodeChanged(MapRecord.java:450) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:496) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:441) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:619) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:566) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:423) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:619) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:423) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:619) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:423) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:619) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:496) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:619) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:55) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:61) [org.apache.jackrabbit.oak-store-spi:1.8.7]

at org.apache.jackrabbit.oak.segment.scheduler.Commit.apply(Commit.java:72) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.scheduler.LockBasedScheduler.execute(LockBasedScheduler.java:265) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.scheduler.LockBasedScheduler.schedule(LockBasedScheduler.java:236) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.segment.SegmentNodeStore.merge(SegmentNodeStore.java:195) [org.apache.jackrabbit.oak-segment-tar:1.8.7]

at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:250) [org.apache.jackrabbit.oak-core:1.8.7]

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:347) [org.apache.jackrabbit.oak-jcr:1.8.7]

at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:494) [org.apache.jackrabbit.oak-jcr:1.8.7]

... 138 common frames omitted

0 Replies