mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 15:32:14 +00:00
Same perm check for generic details
This commit is contained in:
@@ -46,6 +46,7 @@ class PersonDetail(GenericDetailView):
|
|||||||
context['update_link'] = 'person_update'
|
context['update_link'] = 'person_update'
|
||||||
context['associated'] = 'partials/associated_organisations.html'
|
context['associated'] = 'partials/associated_organisations.html'
|
||||||
context['associated2'] = 'partials/associated_events.html'
|
context['associated2'] = 'partials/associated_events.html'
|
||||||
|
context['can_edit'] = self.request.user.has_perm('RIGS.change_person')
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
@@ -88,6 +89,7 @@ class OrganisationDetail(GenericDetailView):
|
|||||||
context['update_link'] = 'organisation_update'
|
context['update_link'] = 'organisation_update'
|
||||||
context['associated'] = 'partials/associated_people.html'
|
context['associated'] = 'partials/associated_people.html'
|
||||||
context['associated2'] = 'partials/associated_events.html'
|
context['associated2'] = 'partials/associated_events.html'
|
||||||
|
context['can_edit'] = self.request.user.has_perm('RIGS.change_organisation')
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
@@ -128,6 +130,7 @@ class VenueDetail(GenericDetailView):
|
|||||||
context['detail_link'] = 'venue_detail'
|
context['detail_link'] = 'venue_detail'
|
||||||
context['update_link'] = 'venue_update'
|
context['update_link'] = 'venue_update'
|
||||||
context['associated2'] = 'partials/associated_events.html'
|
context['associated2'] = 'partials/associated_events.html'
|
||||||
|
context['can_edit'] = self.request.user.has_perm('RIGS.change_venue')
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -252,6 +252,7 @@ class SupplierDetail(GenericDetailView):
|
|||||||
context['override'] = "base_ajax.html"
|
context['override'] = "base_ajax.html"
|
||||||
else:
|
else:
|
||||||
context['override'] = 'base_assets.html'
|
context['override'] = 'base_assets.html'
|
||||||
|
context['can_edit'] = self.request.user.has_perm('assets.change_supplier')
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,9 +48,11 @@
|
|||||||
{% if not request.is_ajax %}
|
{% if not request.is_ajax %}
|
||||||
<div class="row py-2">
|
<div class="row py-2">
|
||||||
<div class="col-sm-12 text-right">
|
<div class="col-sm-12 text-right">
|
||||||
|
{% if can_edit %}
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
{% button 'edit' update_link object.pk %}
|
{% button 'edit' update_link object.pk %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% include 'partials/last_edited.html' with target=history_link %}
|
{% include 'partials/last_edited.html' with target=history_link %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -63,7 +65,9 @@
|
|||||||
<div class="btn-group btn-page">
|
<div class="btn-group btn-page">
|
||||||
<a href="{% url detail_link object.pk %}" class="btn btn-primary"><span
|
<a href="{% url detail_link object.pk %}" class="btn btn-primary"><span
|
||||||
class="fas fa-eye"></span> Open Page</a>
|
class="fas fa-eye"></span> Open Page</a>
|
||||||
|
{% if can_edit %}
|
||||||
{% button 'edit' update_link object.pk %}
|
{% button 'edit' update_link object.pk %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% include 'partials/last_edited.html' with target=history_link %}
|
{% include 'partials/last_edited.html' with target=history_link %}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user