@@ -414,15 +414,15 @@ func RegisterRoutes(m *web.Route) {
414
414
m .Group ("/user/settings" , func () {
415
415
m .Get ("" , user_setting .Profile )
416
416
m .Post ("" , bindIgnErr (forms.UpdateProfileForm {}), user_setting .ProfilePost )
417
- m .Get ("/change_password" , userSettingModuleEnabled ("password" ), auth .MustChangePassword )
418
- m .Post ("/change_password" , userSettingModuleEnabled ("password" ), bindIgnErr (forms.MustChangePasswordForm {}), auth .MustChangePasswordPost )
417
+ m .Get ("/change_password" , userSettingModuleEnabled (user_setting . UserPasswordKey ), auth .MustChangePassword )
418
+ m .Post ("/change_password" , userSettingModuleEnabled (user_setting . UserPasswordKey ), bindIgnErr (forms.MustChangePasswordForm {}), auth .MustChangePasswordPost )
419
419
m .Post ("/avatar" , bindIgnErr (forms.AvatarForm {}), user_setting .AvatarPost )
420
420
m .Post ("/avatar/delete" , user_setting .DeleteAvatar )
421
421
m .Group ("/account" , func () {
422
422
m .Combo ("" ).Get (user_setting .Account ).Post (bindIgnErr (forms.ChangePasswordForm {}), user_setting .AccountPost )
423
423
m .Post ("/email" , bindIgnErr (forms.AddEmailForm {}), user_setting .EmailPost )
424
424
m .Post ("/email/delete" , user_setting .DeleteEmail )
425
- m .Post ("/delete" , userSettingModuleEnabled ("deletion" ), user_setting .DeleteAccount )
425
+ m .Post ("/delete" , userSettingModuleEnabled (user_setting . UserDeletionKey ), user_setting .DeleteAccount )
426
426
})
427
427
m .Group ("/appearance" , func () {
428
428
m .Get ("" , user_setting .Appearance )
@@ -449,18 +449,18 @@ func RegisterRoutes(m *web.Route) {
449
449
m .Post ("/toggle_visibility" , security .ToggleOpenIDVisibility )
450
450
}, openIDSignInEnabled )
451
451
m .Post ("/account_link" , linkAccountEnabled , security .DeleteAccountLink )
452
- }, userSettingModuleEnabled ("security" ))
452
+ }, userSettingModuleEnabled (user_setting . UserSecurityKey ))
453
453
m .Group ("/applications/oauth2" , func () {
454
454
m .Get ("/{id}" , user_setting .OAuth2ApplicationShow )
455
455
m .Post ("/{id}" , bindIgnErr (forms.EditOAuth2ApplicationForm {}), user_setting .OAuthApplicationsEdit )
456
456
m .Post ("/{id}/regenerate_secret" , user_setting .OAuthApplicationsRegenerateSecret )
457
457
m .Post ("" , bindIgnErr (forms.EditOAuth2ApplicationForm {}), user_setting .OAuthApplicationsPost )
458
458
m .Post ("/{id}/delete" , user_setting .DeleteOAuth2Application )
459
459
m .Post ("/{id}/revoke/{grantId}" , user_setting .RevokeOAuth2Grant )
460
- }, userSettingModuleEnabled ("applications" ))
461
- m .Combo ("/applications" ).Get (userSettingModuleEnabled ("applications" ), user_setting .Applications ).
462
- Post (userSettingModuleEnabled ("applications" ), bindIgnErr (forms.NewAccessTokenForm {}), user_setting .ApplicationsPost )
463
- m .Post ("/applications/delete" , userSettingModuleEnabled ("applications" ), user_setting .DeleteApplication )
460
+ }, userSettingModuleEnabled (user_setting . UserApplicationKey ))
461
+ m .Combo ("/applications" ).Get (userSettingModuleEnabled (user_setting . UserApplicationKey ), user_setting .Applications ).
462
+ Post (userSettingModuleEnabled (user_setting . UserApplicationKey ), bindIgnErr (forms.NewAccessTokenForm {}), user_setting .ApplicationsPost )
463
+ m .Post ("/applications/delete" , userSettingModuleEnabled (user_setting . UserApplicationKey ), user_setting .DeleteApplication )
464
464
m .Combo ("/keys" ).Get (user_setting .Keys ).
465
465
Post (bindIgnErr (forms.AddKeyForm {}), user_setting .KeysPost )
466
466
m .Post ("/keys/delete" , user_setting .DeleteKey )
@@ -478,7 +478,7 @@ func RegisterRoutes(m *web.Route) {
478
478
})
479
479
})
480
480
}, packagesEnabled )
481
- m .Get ("/organization" , userSettingModuleEnabled ("organizations" ), user_setting .Organization )
481
+ m .Get ("/organization" , userSettingModuleEnabled (user_setting . UserOrganizations ), user_setting .Organization )
482
482
m .Get ("/repos" , user_setting .Repos )
483
483
m .Post ("/repos/unadopted" , user_setting .AdoptOrDeleteRepository )
484
484
}, reqSignIn , func (ctx * context.Context ) {
0 commit comments