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
1=== modified file 'src/postorius/templates/postorius/lists/summary.html'
2--- src/postorius/templates/postorius/lists/summary.html 2015-01-19 15:03:09 +0000
3+++ src/postorius/templates/postorius/lists/summary.html 2015-03-22 15:07:56 +0000
4@@ -6,7 +6,7 @@
5 {% block body_class %}list_summary{% endblock %}
6
7 {% block main %}
8- {% 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' %}
11 {% endif %}
12 <h1>{{list.display_name}}</h1>
13
14=== modified file 'src/postorius/views/list.py'
15--- src/postorius/views/list.py 2015-02-09 14:35:44 +0000
16+++ src/postorius/views/list.py 2015-03-22 15:07:56 +0000
17@@ -235,7 +235,7 @@
18
19 """Mass subscription."""
20
21- @method_decorator(list_owner_required)
22+ @method_decorator(list_moderator_required)
23 def get(self, request, *args, **kwargs):
24 form = ListMassSubscription()
25 return render_to_response('postorius/lists/mass_subscribe.html',
26@@ -474,7 +474,8 @@
27 context_instance=RequestContext(request))
28
29
30-@list_owner_required
31+
32+@list_moderator_required
33 def list_held_messages(request, list_id):
34 """Shows a list of held messages.
35 """
36@@ -487,7 +488,7 @@
37 context_instance=RequestContext(request))
38
39
40-@list_owner_required
41+@list_moderator_required
42 def accept_held_message(request, list_id, msg_id):
43 """Accepts a held message.
44 """
45@@ -503,7 +504,7 @@
46 return redirect('list_held_messages', the_list.list_id)
47
48
49-@list_owner_required
50+@list_moderator_required
51 def discard_held_message(request, list_id, msg_id):
52 """Accepts a held message.
53 """
54@@ -519,7 +520,7 @@
55 return redirect('list_held_messages', the_list.list_id)
56
57
58-@list_owner_required
59+@list_moderator_required
60 def defer_held_message(request, list_id, msg_id):
61 """Accepts a held message.
62 """
63@@ -535,7 +536,7 @@
64 return redirect('list_held_messages', the_list.list_id)
65
66
67-@list_owner_required
68+@list_moderator_required
69 def reject_held_message(request, list_id, msg_id):
70 """Accepts a held message.
71 """

Subscribers

People subscribed via source and target branches