Stash REST API's

Hi,

I am looking for Stash REST API's which allow me to tweak project permissions to enable public access and raise the default permission level for the project from 'no access' to 'read' .

From the documentation, i don't see any or may be i am missing it

I am basically trying to say that all authenticated users should be able to browse all repositories even though their groups haven't been explicitly mapped for that project or repository

Is there an alternate way to do it globally without having this to configure for every project ? 

Regards,

Rahul


 

 

2 answers

1 accepted

1 vote

Hello Rahul, 

there is a REST Endpoint for what you are trying to do. Check out the docs here.
For your case I believe you would want to POST to

/rest/api/1.0/projects/{projectKey}/permissions/PROJECT_READ/all?allow=true

This would grant all users read access to the project with the key you specify in the REST url.

I hope that helps, 

Felix

Rahul,

There has just been a brand new Stash Add-on released to the Marketplace which helps a lot with updating all of your projects or repositories in bulk with just one script. You can find the relevant section in our documentation here:

https://scriptrunner.adaptavist.com/stash/latest/docs/script_console/#bulk-project-permissions-update

You can also set project and repository defaults for all future creations as they happen based on the project create or repository create event. You can find the relevant section related to setting default permissions for projects and repositories in our documentation:

https://scriptrunner.adaptavist.com/stash/latest/docs/event_handlers/#default-project-repository-permissions

Feel free to take a look, it's called ScriptRunner for Stash and in the Marketplace now.

You can get an overview of both of these Administration features by watching this Admin video:

https://www.youtube.com/watch?v=iRnD00EPmQE

Your answer is not pertinent. The question was about the REST API.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,762 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you