Bhavesh Goyal has proposed merging 
lp:~bhavesh-goyal093/postorius/fixed-nav-role-identification into lp:postorius.

Requested reviews:
  Mailman Coders (mailman-coders)
Related bugs:
  Bug #1431474 in Postorius: "User roles not correctly identified in postorius 
nav bar"
  https://bugs.launchpad.net/postorius/+bug/1431474

For more details, see:
https://code.launchpad.net/~bhavesh-goyal093/postorius/fixed-nav-role-identification/+merge/253771

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.
-- 
Your team Mailman Coders is requested to review the proposed merge of 
lp:~bhavesh-goyal093/postorius/fixed-nav-role-identification into lp:postorius.
=== 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 @@
 {% block body_class %}list_summary{% endblock %}
 
 {% block main %}
-    {% if user.is_superuser %}
+    {% if user.is_superuser or user.is_list_owner or user.is_list_moderator %}
         {% include 'postorius/menu/list_nav.html' %}
     {% endif %}
     <h1>{{list.display_name}}</h1>

=== 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 @@
 
     """Mass subscription."""
 
-    @method_decorator(list_owner_required)
+    @method_decorator(list_moderator_required)
     def get(self, request, *args, **kwargs):
         form = ListMassSubscription()
         return render_to_response('postorius/lists/mass_subscribe.html',
@@ -474,7 +474,8 @@
             context_instance=RequestContext(request))
 
 
-@list_owner_required
+ 
+@list_moderator_required
 def list_held_messages(request, list_id):
     """Shows a list of held messages.
     """
@@ -487,7 +488,7 @@
                               context_instance=RequestContext(request))
 
 
-@list_owner_required
+@list_moderator_required
 def accept_held_message(request, list_id, msg_id):
     """Accepts a held message.
     """
@@ -503,7 +504,7 @@
     return redirect('list_held_messages', the_list.list_id)
 
 
-@list_owner_required
+@list_moderator_required
 def discard_held_message(request, list_id, msg_id):
     """Accepts a held message.
     """
@@ -519,7 +520,7 @@
     return redirect('list_held_messages', the_list.list_id)
 
 
-@list_owner_required
+@list_moderator_required
 def defer_held_message(request, list_id, msg_id):
     """Accepts a held message.
     """
@@ -535,7 +536,7 @@
     return redirect('list_held_messages', the_list.list_id)
 
 
-@list_owner_required
+@list_moderator_required
 def reject_held_message(request, list_id, msg_id):
     """Accepts a held message.
     """

_______________________________________________
Mailman-coders mailing list
[email protected]
https://mail.python.org/mailman/listinfo/mailman-coders

Reply via email to