Skip to content
Snippets Groups Projects
Verified Commit f49b0514 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Allow users to change their password. Closes #354

parent dd3aa077
No related branches found
No related tags found
2 merge requests!474Resolve "Change password",!413Resolve "User registration"
Pipeline #5727 failed
......@@ -63,6 +63,12 @@ MENUS = {
"icon": "phonelink_lock",
"validators": ["menu_generator.validators.is_authenticated",],
},
{
"name": _("Change password"),
"url": "account_change_password",
"icon": "password",
"validators": ["menu_generator.validators.is_authenticated", ("aleksis.core.util.predicates.permission_validator", "core.can_change_password")],
},
{
"name": _("Me"),
"url": "person",
......
......@@ -208,6 +208,14 @@ class SchoolNameOfficial(StringPreference):
verbose_name = _("Official name of the school, e.g. as given by supervisory authority")
@site_preferences_registry.register
class AllowPasswordChange(BooleanPreference):
section = auth
name = "allow_password_change"
default = True
verbose_name = _("Allow users to change their passwords")
@site_preferences_registry.register
class SignupEnabled(BooleanPreference):
section = auth
......
......@@ -318,6 +318,9 @@ rules.add_perm("core.edit_default_dashboard", edit_default_dashboard_predicate)
can_register_predicate = is_site_preference_set(section="auth", pref="signup_enabled")
rules.add_perm("core.can_register", can_register_predicate)
can_change_password_predicate = is_site_preference_set(section="auth", pref="allow_password_change")
rules.add_perm("core.can_change_password", can_change_password_predicate)
# Upload and browse files via CKEditor
upload_files_ckeditor_predicate = has_person & has_global_perm("core.upload_files_ckeditor")
rules.add_perm("core.upload_files_ckeditor", upload_files_ckeditor_predicate)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment