Omit "edit" link unless user has perm, for Customer "people" subgrid

This commit is contained in:
Lance Edgar 2021-10-28 19:00:56 -05:00
parent 4dfc29768c
commit 7b5e2d17f3

View file

@ -262,9 +262,11 @@ class CustomerView(MasterView):
'last_name': person.last_name, 'last_name': person.last_name,
'_action_url_view': self.request.route_url('people.view', '_action_url_view': self.request.route_url('people.view',
uuid=person.uuid), uuid=person.uuid),
'_action_url_edit': self.request.route_url('people.edit',
uuid=person.uuid),
} }
if self.editable and self.request.has_perm('people.edit'):
data['_action_url_edit'] = self.request.route_url(
'people.edit',
uuid=person.uuid)
if self.people_detachable and self.has_perm('detach_person'): if self.people_detachable and self.has_perm('detach_person'):
data['_action_url_detach'] = self.request.route_url( data['_action_url_detach'] = self.request.route_url(
'customers.detach_person', 'customers.detach_person',