From 7e09d210ba421a1baf03ef7ba8770bebe8d28b72 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 17 Feb 2017 15:10:50 -0500 Subject: Initial version of protected branches (#776) - Able to restrict force push and deletion - Able to restrict direct push --- modules/context/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/context') diff --git a/modules/context/repo.go b/modules/context/repo.go index 924898aa..97fd3e36 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -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 -- cgit v1.2.3