Skip to content

Commit

Permalink
TRUNK-6263 AuthorizationAdvice should check for daemon thread
Browse files Browse the repository at this point in the history
  • Loading branch information
dkayiwa committed Sep 6, 2024
1 parent 03a87de commit e883c9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/src/main/java/org/openmrs/aop/AuthorizationAdvice.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.openmrs.annotation.AuthorizedAnnotationAttributes;
import org.openmrs.api.APIAuthenticationException;
import org.openmrs.api.context.Context;
import org.openmrs.api.context.Daemon;
import org.openmrs.util.PrivilegeConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -55,6 +56,10 @@ public void before(Method method, Object[] args, Object target) throws Throwable
}
}

if (Daemon.isDaemonThread()) {
return;
}

AuthorizedAnnotationAttributes attributes = new AuthorizedAnnotationAttributes();
Collection<String> privileges = attributes.getAttributes(method);
boolean requireAll = attributes.getRequireAll(method);
Expand Down

0 comments on commit e883c9b

Please sign in to comment.