diff options
author | Unknwon <u@gogs.io> | 2017-02-17 15:10:50 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-17 15:10:50 -0500 |
commit | 7e09d210ba421a1baf03ef7ba8770bebe8d28b72 (patch) | |
tree | 1d209f6175c3e4d7e21c4bda62e65db0ac4608f5 /modules/context/repo.go | |
parent | dab768212af15f4e671e5403ad3def455117f699 (diff) |
Initial version of protected branches (#776)
- Able to restrict force push and deletion
- Able to restrict direct push
Diffstat (limited to 'modules/context/repo.go')
-rw-r--r-- | modules/context/repo.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 |