mirror of
https://github.com/gogs/gogs.git
synced 2026-07-01 01:17:33 +02:00
Initial version of protected branches (#776)
- Able to restrict force push and deletion - Able to restrict direct push
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user