diff options
author | Paweł Bogusławski <pawel.boguslawski@ib.pl> | 2020-12-21 15:39:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-21 15:39:41 +0100 |
commit | 839daa85aaba5172b3dd2b3f882aa9639a09f13a (patch) | |
tree | cc99ed17087fd3b3b44cdb650efe16e6f0394e55 /routers/admin/users.go | |
parent | 3a500cf8c4b7892e13cb506af6fe3ab5c1c2faff (diff) | |
download | gitea-839daa85aaba5172b3dd2b3f882aa9639a09f13a.tar.gz gitea-839daa85aaba5172b3dd2b3f882aa9639a09f13a.zip |
Added option to disable migrations (#13114)
* Added option to disable migrations
This patch introduces DISABLE_MIGRATIONS parameter in [repository]
section of app.ini (by default set to false). If set to true
it blocks access to repository migration feature.
This mod hides also local repo import option in user editor if
local repo importing or migrations is disabled.
* Alter Example config
DISABLE_MIGRATIONS set to false in example config to
match its default value.
* HTTP error 403 instead of 500 on denied access to migration
* Parameter DISABLE_MIGRATIONS exposed via API
Fixes: 04b04cf854bcb3ed7659442bcf79822bdebe29e9
Author-Change-Id: IB#1105130
Diffstat (limited to 'routers/admin/users.go')
-rw-r--r-- | routers/admin/users.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/admin/users.go b/routers/admin/users.go index 4382ee3877..06c391b8e0 100644 --- a/routers/admin/users.go +++ b/routers/admin/users.go @@ -191,6 +191,7 @@ func EditUser(ctx *context.Context) { ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminUsers"] = true ctx.Data["DisableRegularOrgCreation"] = setting.Admin.DisableRegularOrgCreation + ctx.Data["DisableMigrations"] = setting.Repository.DisableMigrations prepareUserInfo(ctx) if ctx.Written() { @@ -205,6 +206,7 @@ func EditUserPost(ctx *context.Context, form auth.AdminEditUserForm) { ctx.Data["Title"] = ctx.Tr("admin.users.edit_account") ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdminUsers"] = true + ctx.Data["DisableMigrations"] = setting.Repository.DisableMigrations u := prepareUserInfo(ctx) if ctx.Written() { |