Skip to content
Snippets Groups Projects
Commit f1645a45 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

Also show menu if user is anonymous

parent d76aa630
No related branches found
No related tags found
1 merge request!52Resolve "Register account menu point is not shown"
Pipeline #173586 passed with warnings
......@@ -5,6 +5,7 @@ from aleksis.core.util.predicates import (
has_global_perm,
has_object_perm,
has_person,
is_anonymous,
)
from .models import Event, EventRegistration, Terms, Voucher
......@@ -238,13 +239,16 @@ create_registration_states_predicate = has_person & (
rules.add_perm("paweljong.create_registration_states_rule", create_registration_states_predicate)
# View menu
can_view_menu_predicate = has_person & (
view_info_mailings_predicate
| view_terms_predicate
| view_vouchers_predicate
| change_events_predicate
| view_registration_states_predicate
)
can_view_menu_predicate = (
has_person
& (
view_info_mailings_predicate
| view_terms_predicate
| view_vouchers_predicate
| change_events_predicate
| view_registration_states_predicate
)
) | is_anonymous
rules.add_perm("paweljong.view_menu", can_view_menu_predicate)
can_retract_registration_predicate = has_person & (is_organiser)
......
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