@@ -98,6 +98,8 @@ def save_milestone_in_history(milestone):
9898 return h
9999
100100def can_manage_group_type (user , group , type_id = None ):
101+ if not user .is_authenticated :
102+ return False
101103 if type_id is None :
102104 type_id = group .type_id
103105 log .assertion ("isinstance(type_id, (type(''), type(u'')))" )
@@ -117,7 +119,7 @@ def can_manage_group_type(user, group, type_id=None):
117119def can_manage_group (user , group ):
118120 if can_manage_group_type (user , group ):
119121 return True
120- return group .has_role (user , group .features .admin_roles )
122+ return group .has_role (user , group .features .groupman_roles )
121123
122124def milestone_reviewer_for_group_type (group_type ):
123125 if group_type == "rg" :
@@ -203,12 +205,11 @@ def construct_group_menu_context(request, group, selected, group_type, others):
203205 # actions
204206 actions = []
205207
206- is_admin = group .has_role (request .user , group .features .admin_roles )
207- can_manage = can_manage_group_type (request .user , group )
208+ can_manage = can_manage_group (request .user , group )
208209 can_edit_group = False # we'll set this further down
209210
210211 if group .features .has_milestones :
211- if group .state_id != "proposed" and ( is_admin or can_manage ) :
212+ if group .state_id != "proposed" and can_manage :
212213 actions .append ((u"Edit milestones" , urlreverse ('ietf.group.milestones.edit_milestones;current' , kwargs = kwargs )))
213214
214215 if group .features .has_documents :
@@ -229,11 +230,11 @@ def construct_group_menu_context(request, group, selected, group_type, others):
229230 actions .append ((u"Secretary settings" , urlreverse (ietf .group .views .change_review_secretary_settings , kwargs = kwargs )))
230231 actions .append ((u"Email open assignments summary" , urlreverse (ietf .group .views .email_open_review_assignments , kwargs = dict (acronym = group .acronym , group_type = group .type_id ))))
231232
232- if group .state_id != "conclude" and ( is_admin or can_manage ) :
233+ if group .state_id != "conclude" and can_manage :
233234 can_edit_group = True
234235 actions .append ((u"Edit group" , urlreverse ("ietf.group.views.edit" , kwargs = dict (kwargs , action = "edit" ))))
235236
236- if group .features .customize_workflow and ( is_admin or can_manage ) :
237+ if group .features .customize_workflow and can_manage :
237238 actions .append ((u"Customize workflow" , urlreverse ("ietf.group.views.customize_workflow" , kwargs = kwargs )))
238239
239240 if group .state_id in ("active" , "dormant" ) and not group .type_id in ["sdo" , "rfcedtyp" , "isoc" , ] and can_manage :
0 commit comments