Skip to main content
Skip table of contents

Bitbucket Post Webhooks User does not have permissions exception

Details about cause of the IllegalArgumentException: User doesn’t have permissions for Bitbucket Post Webhooks Atlassian App

Issue

This page could be helpful if you see anything like the exception below related to https://marketplace.atlassian.com/apps/1215474/post-webhooks-for-bitbucket?hosting=datacenter&tab=overview .

The cause of the exception is that the user who accesses the app configuration on the repository level does not have permission to read it.

Another possible scenario is when Jenkins or an automation script creates a repository-level configuration rule and uses a user who can only read the Bitbucket repository, but not an admin.

Solution

To avoid this, the global admin can enable a global setting “Allow repository readers to read repository configurations“. This will permit users who are only repository readers and not repository owners/admins to read the Bitbucket Post Webhook configurations for the repository

Programmatic change

You can change the global settings using the APIs below.

GET/POST <BITBUCKET_BASE_URL>/bitbucket/rest/webhook/1.0/global-settings

JSON
{
   "appEnabledInEntitites":true,
   "appDisabledInEntities":false,
   "auditMessagesEnabled":false,
   "auditSettingsEnabled":false,
   "analyticsEnabled":false,
   "urlManagement":{
      "enabled":true,
      "excludedSources":[
         
      ],
      "excludedUsers":[
         
      ],
      "onlyManagedUrls":false
   },
   "licenseInfo":{
      
   },
   "fullScanForBuildStatusEnabled":false,
   "multipleConfigurationsAllowed":true,
   "appendServerUrl":false,
   "handleProjectRepositoryModifications":true,
   "alwaysExecuteGlobalLevel":false,
   "alwaysExecuteProjectLevel":false,
   "disabledOldApi":false,
   "allowedModificationForWriters":false,
   "allowedModificationForReaders":false,
   "connectionTimeout":30
}

Updated:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.