Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can Stash (or a Stash hook) manage commit permissions on specific files or directories?

Jon Sword January 18, 2014

We have certain files/directories within a branch that can only be modified by special users. This was easy in SVN - but I can not find a way to do this in Stash.

Any suggestions?

Thx

Jon

1 answer

1 accepted

1 vote
Answer accepted
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2014

Hi Jon,

This is obviously not possible in Stash at this stage.

It could be done fairly easily as a plugin. You could add a pre-receive hook that looks at the new commits, calculates what files/directories have been modified and rejects/accepts the push accordingly. Here is an example of a hook I wrote that blocks pushes with large files, which might be a good place to start

That said, my advice would be to split up your repository into smaller repositories and define your permissions at that level. This is something that will play better with Stash (and most other Git hosting solutions which don't support this feature either). At this point you could have repository write permissions (or branch permissions on master) and only certain people can push/merge to them.

Cheers,

Charles

Jon Sword January 24, 2014

Thanks Charles - we will investigate breaking the areas into seperate repos.

Cheers,

Jon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events