-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow options to disable user deletion from the interface on app.ini #29275
Conversation
routers/web/web.go
Outdated
@@ -403,6 +403,14 @@ func registerRoutes(m *web.Route) { | |||
} | |||
} | |||
|
|||
userSettingModuleEnabled := func(module string) func(ctx *context.Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems an over-engendering. It could be simply checked in user_setting.DeleteAccount
, instead of bloating the "web.go", it has been much too large.
routers/web/web.go
Outdated
@@ -565,7 +573,7 @@ func registerRoutes(m *web.Route) { | |||
m.Combo("").Get(user_setting.Account).Post(web.Bind(forms.ChangePasswordForm{}), user_setting.AccountPost) | |||
m.Post("/email", web.Bind(forms.AddEmailForm{}), user_setting.EmailPost) | |||
m.Post("/email/delete", user_setting.DeleteEmail) | |||
m.Post("/delete", user_setting.DeleteAccount) | |||
m.Post("/delete", userSettingModuleEnabled(setting.UserDeletionKey), user_setting.DeleteAccount) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need some test code for the DeleteAccount
request?
…user settings, it can also affect others of user
I renamed it to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made some changes, not tested yet, overall LGTM
* giteaofficial/main: Adjust changelog for v1.21.6 to move prs to correct labels (go-gitea#29339) (go-gitea#29343) Allow options to disable user deletion from the interface on app.ini (go-gitea#29275)
Extract from #20549
This PR added a new option on app.ini
[admin]USER_DISABLED_FEATURES
to allow the site administrator to disable users visiting deletion user interface or allow.This options are also potentially allowed to define more features in future PRs.