Web editor: disallow edit mirror repository

This commit is contained in:
Unknwon 2016-08-28 04:56:41 -07:00
parent ba27d71abe
commit 579e5e4fee
7 changed files with 36 additions and 25 deletions

View file

@ -444,6 +444,11 @@ func (repo *Repository) AllowsPulls() bool {
return repo.CanEnablePulls() && repo.EnablePulls
}
// CanEnableEditor returns true if repository meets the requirements of web editor.
func (repo *Repository) CanEnableEditor() bool {
return !repo.IsMirror
}
// FIXME: should have a mutex to prevent producing same index for two issues that are created
// closely enough.
func (repo *Repository) NextIssueIndex() int64 {