Skip to content
This repository
Browse code

simplified the toolbar permissions

  • Loading branch information...
commit f79257f6cdaebbb443760973840c9e93ee91a36c 1 parent 04a457e
Ales Kocjancic authored June 07, 2012

Showing 1 changed file with 5 additions and 8 deletions. Show diff stats Hide diff stats

  1. 13  cms/cms_toolbar.py
13  cms/cms_toolbar.py
@@ -13,6 +13,7 @@
13 13
 from django.utils.translation import ugettext_lazy as _
14 14
 import urllib
15 15
 from utils.permissions import has_page_change_permission, has_any_page_change_permissions
  16
+from django.conf import settings
16 17
 
17 18
 
18 19
 def _get_page_admin_url(context, toolbar, **kwargs):
@@ -115,21 +116,17 @@ def get_items(self, context, **kwargs):
115 116
                         GetButton(RIGHT, 'moderator', label, urlgetter)
116 117
                     )
117 118
 
118  
-                has_global_current_page_change_permission = has_page_change_permission(self.request)
119  
-                has_global_any_page_change_permission = has_any_page_change_permissions(self.request)
  119
+                has_global_current_page_change_permission = False
  120
+                if settings.CMS_PERMISSION:
  121
+                    has_global_current_page_change_permission = has_page_change_permission(self.request)
120 122
                 has_current_page_change_permission = self.request.current_page.has_change_permission(self.request)
121  
-                has_any_page_permission = self.request.current_page.has_change_permission(self.request) or \
122  
-                                                 self.request.current_page.has_add_permission(self.request) or \
123  
-                                                 self.request.current_page.has_delete_permission(self.request) or \
124  
-                                                 self.request.current_page.has_move_page_permission(self.request)
125 123
 
126 124
                 # The 'templates' Menu
127 125
                 if has_global_current_page_change_permission or has_current_page_change_permission:
128 126
                     items.append(self.get_template_menu(context, self.can_change, self.is_staff))
129 127
                 
130 128
                 # The 'page' Menu
131  
-                if has_global_any_page_change_permission or has_any_page_permission:
132  
-                    items.append(self.get_page_menu(context, self.can_change, self.is_staff))
  129
+                items.append(self.get_page_menu(context, self.can_change, self.is_staff))
133 130
             
134 131
             # The 'Admin' Menu
135 132
             items.append(self.get_admin_menu(context, self.can_change, self.is_staff))

0 notes on commit f79257f

Please sign in to comment.
Something went wrong with that request. Please try again.