mohamicorp / stash-jenkins-postreceive-webhook

Webhook used to notify Jenkins when commits are made to Stash
Other
138 stars 98 forks source link

AccessDeniedException on commit of non-admin user #41

Closed kuhnroyal closed 10 years ago

kuhnroyal commented 10 years ago

I am getting this when a non admin user commits to the branch, no build is scheduled in jenkins. Admin users can commit and trigger the build.

c.a.s.i.e.AsyncBatchingInvokersTransformer There was an exception thrown trying to dispatch event 'com.atlassian.stash.event.RepositoryPushEvent[source=com.atlassian.stash.internal.hook.PostReceiveEventHook@3cecd9df]' for the invoker 'SingleParameterMethodListenerInvoker{method=public void com.nerdwin15.stash.webhook.RepositoryChangeListener.onRefsChangedEvent(com.atlassian.stash.event.RepositoryRefsChangedEvent), listener=com.nerdwin15.stash.webhook.RepositoryChangeListener@443ca59a}'.
java.lang.RuntimeException: You are not permitted to access this resource
        at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54) ~[atlassian-event-2.3.0.jar:na]
        at com.atlassian.stash.internal.event.AsyncBatchingInvokersTransformer$AsyncInvokerBatch.invoke(AsyncBatchingInvokersTransformer.java:100) ~[stash-platform-2.9.4.jar:na]
        at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$2.run(AsynchronousAbleEventDispatcher.java:66) [atlassian-event-2.3.0.jar:na]
        at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:38) [sal-core-2.10.9.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
        at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
        ... 1 frame trimmed
Caused by: com.atlassian.stash.exception.AuthorisationException: You are not permitted to access this resource
        at com.atlassian.stash.internal.aop.ExceptionRewriteAdvice.afterThrowing(ExceptionRewriteAdvice.java:36) ~[stash-platform-2.9.4.jar:na]
        at com.sun.proxy.$Proxy194.getSettings(Unknown Source) ~[na:na]
        at com.sun.proxy.$Proxy230.getSettings(Unknown Source) ~[na:na]
        at com.sun.proxy.$Proxy230.getSettings(Unknown Source) ~[na:na]
        at com.nerdwin15.stash.webhook.service.eligibility.IgnoreCommittersEligibilityFilter.shouldDeliverNotification(IgnoreCommittersEligibilityFilter.java:39) ~[na:na]
        at com.nerdwin15.stash.webhook.service.eligibility.ConcreteEligibilityFilterChain.shouldDeliverNotification(ConcreteEligibilityFilterChain.java:27) ~[na:na]
        at com.nerdwin15.stash.webhook.RepositoryChangeListener.onRefsChangedEvent(RepositoryChangeListener.java:34) ~[na:na]
        at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:36) ~[atlassian-event-2.3.0.jar:na]
        ... 6 common frames omitted
Caused by: org.springframework.security.access.AccessDeniedException: Access is denied
        at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:83) ~[spring-security-core-3.1.4.RELEASE.jar:3.1.4.RELEASE]
        ... 13 common frames omitted
mikesir87 commented 10 years ago

Are you running the latest version of the plugin? Should be 2.0.1.

kuhnroyal commented 10 years ago

Good point, was still running a SNAPSHOT that I installed when I added the Stash 2.6 support. My bad. Thanks!