From 579e5e4fee59f01f8a438e7ef977f34fa5dba72c Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 28 Aug 2016 04:56:41 -0700 Subject: Web editor: disallow edit mirror repository --- models/repo.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'models/repo.go') diff --git a/models/repo.go b/models/repo.go index aab35785fc..a8cc47885f 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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 { -- cgit v1.2.3