Merge lp:~bhavesh-goyal093/postorius/fixed-nav-role-identification into lp:postorius

Proposed by Bhavesh Goyal
Status: Merged
Merged at revision: 211
Proposed branch: lp:~bhavesh-goyal093/postorius/fixed-nav-role-identification
Merge into: lp:postorius
Diff against target: 71 lines (+8/-7)
2 files modified
src/postorius/templates/postorius/lists/summary.html (+1/-1)
src/postorius/views/list.py (+7/-6)
To merge this branch: bzr merge lp:~bhavesh-goyal093/postorius/fixed-nav-role-identification
Reviewer Review Type Date Requested Status
Terri Needs Fixing
Review via email: mp+253771@code.launchpad.net

Description of the change

Fixed Bug #1431474

Mailman offers different views for different roles in list nav bar. Earlier if the user had some access privileges for instance (a moderator), the the nav bar options which he got were the same as that of a normal subscriber. Manually opening the page from URL though allowed the user to access the privileged controls.
Now, a correct view is given for each of the member roles by changing the if condition of list_summary template which was earlier set to display nav options only for super users.

Also, Certain List Pages such as Held_messages were not accessible to moderators even though they have the right to access them and were given only to owners. Now The Permissions of the page are also corrected and set to moderators which hold actual control for those pages.

To post a comment you must log in.
Revision history for this message
Terri (terriko) wrote :

I'm rather amused that moderators weren't allowed access to the moderation pages. Silly!

This branch also includes giving moderators access to the mass subscribe interface, which they generally shouldn't have access to. Since it's a short fix to take that out, I'll probably just make the changes when I do the merge.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/postorius/templates/postorius/lists/summary.html'
--- src/postorius/templates/postorius/lists/summary.html 2015-01-19 15:03:09 +0000
+++ src/postorius/templates/postorius/lists/summary.html 2015-03-22 15:07:56 +0000
@@ -6,7 +6,7 @@
6{% block body_class %}list_summary{% endblock %}6{% block body_class %}list_summary{% endblock %}
77
8{% block main %}8{% block main %}
9 {% if user.is_superuser %}9 {% if user.is_superuser or user.is_list_owner or user.is_list_moderator %}
10 {% include 'postorius/menu/list_nav.html' %}10 {% include 'postorius/menu/list_nav.html' %}
11 {% endif %}11 {% endif %}
12 <h1>{{list.display_name}}</h1>12 <h1>{{list.display_name}}</h1>
1313
=== modified file 'src/postorius/views/list.py'
--- src/postorius/views/list.py 2015-02-09 14:35:44 +0000
+++ src/postorius/views/list.py 2015-03-22 15:07:56 +0000
@@ -235,7 +235,7 @@
235235
236 """Mass subscription."""236 """Mass subscription."""
237237
238 @method_decorator(list_owner_required)238 @method_decorator(list_moderator_required)
239 def get(self, request, *args, **kwargs):239 def get(self, request, *args, **kwargs):
240 form = ListMassSubscription()240 form = ListMassSubscription()
241 return render_to_response('postorius/lists/mass_subscribe.html',241 return render_to_response('postorius/lists/mass_subscribe.html',
@@ -474,7 +474,8 @@
474 context_instance=RequestContext(request))474 context_instance=RequestContext(request))
475475
476476
477@list_owner_required477
478@list_moderator_required
478def list_held_messages(request, list_id):479def list_held_messages(request, list_id):
479 """Shows a list of held messages.480 """Shows a list of held messages.
480 """481 """
@@ -487,7 +488,7 @@
487 context_instance=RequestContext(request))488 context_instance=RequestContext(request))
488489
489490
490@list_owner_required491@list_moderator_required
491def accept_held_message(request, list_id, msg_id):492def accept_held_message(request, list_id, msg_id):
492 """Accepts a held message.493 """Accepts a held message.
493 """494 """
@@ -503,7 +504,7 @@
503 return redirect('list_held_messages', the_list.list_id)504 return redirect('list_held_messages', the_list.list_id)
504505
505506
506@list_owner_required507@list_moderator_required
507def discard_held_message(request, list_id, msg_id):508def discard_held_message(request, list_id, msg_id):
508 """Accepts a held message.509 """Accepts a held message.
509 """510 """
@@ -519,7 +520,7 @@
519 return redirect('list_held_messages', the_list.list_id)520 return redirect('list_held_messages', the_list.list_id)
520521
521522
522@list_owner_required523@list_moderator_required
523def defer_held_message(request, list_id, msg_id):524def defer_held_message(request, list_id, msg_id):
524 """Accepts a held message.525 """Accepts a held message.
525 """526 """
@@ -535,7 +536,7 @@
535 return redirect('list_held_messages', the_list.list_id)536 return redirect('list_held_messages', the_list.list_id)
536537
537538
538@list_owner_required539@list_moderator_required
539def reject_held_message(request, list_id, msg_id):540def reject_held_message(request, list_id, msg_id):
540 """Accepts a held message.541 """Accepts a held message.
541 """542 """

Subscribers

People subscribed via source and target branches