aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-28 04:56:41 -0700
committerUnknwon <u@gogs.io>2016-08-28 04:56:41 -0700
commit579e5e4fee59f01f8a438e7ef977f34fa5dba72c (patch)
treeeb949bc9c4a8024067ca1a81f47f1f2c8c48d002 /models/repo.go
parentba27d71abea437af2f0612a8960eea651ec2df59 (diff)
downloadgitea-579e5e4fee59f01f8a438e7ef977f34fa5dba72c.tar.gz
gitea-579e5e4fee59f01f8a438e7ef977f34fa5dba72c.zip
Web editor: disallow edit mirror repository
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go5
1 files changed, 5 insertions, 0 deletions
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 {