diff options
author | Unknwon <u@gogs.io> | 2016-08-28 04:56:41 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-28 04:56:41 -0700 |
commit | 579e5e4fee59f01f8a438e7ef977f34fa5dba72c (patch) | |
tree | eb949bc9c4a8024067ca1a81f47f1f2c8c48d002 /models/repo.go | |
parent | ba27d71abea437af2f0612a8960eea651ec2df59 (diff) | |
download | gitea-579e5e4fee59f01f8a438e7ef977f34fa5dba72c.tar.gz gitea-579e5e4fee59f01f8a438e7ef977f34fa5dba72c.zip |
Web editor: disallow edit mirror repository
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 5 |
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 { |