Initial version of protected branches (#776)

- Able to restrict force push and deletion
- Able to restrict direct push
This commit is contained in:
Unknwon
2017-02-17 15:10:50 -05:00
parent dab768212a
commit 7e09d210ba
26 changed files with 528 additions and 107 deletions

View File

@@ -73,7 +73,7 @@ func (r *Repository) HasAccess() bool {
// CanEnableEditor returns true if repository is editable and user has proper access level.
func (r *Repository) CanEnableEditor() bool {
return r.Repository.CanEnableEditor() && r.IsViewBranch && r.IsWriter()
return r.Repository.CanEnableEditor() && r.IsViewBranch && r.IsWriter() && !r.Repository.IsBranchRequirePullRequest(r.BranchName)
}
// GetEditorconfig returns the .editorconfig definition if found in the