aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo/repo.go')
-rw-r--r--models/repo/repo.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/models/repo/repo.go b/models/repo/repo.go
index 5aae02c6d8..2403b3b40b 100644
--- a/models/repo/repo.go
+++ b/models/repo/repo.go
@@ -652,8 +652,14 @@ func (repo *Repository) AllowsPulls(ctx context.Context) bool {
}
// CanEnableEditor returns true if repository meets the requirements of web editor.
+// FIXME: most CanEnableEditor calls should be replaced with CanContentChange
+// And all other like CanCreateBranch / CanEnablePulls should also be updated
func (repo *Repository) CanEnableEditor() bool {
- return !repo.IsMirror
+ return repo.CanContentChange()
+}
+
+func (repo *Repository) CanContentChange() bool {
+ return !repo.IsMirror && !repo.IsArchived
}
// DescriptionHTML does special handles to description and return HTML string.