mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Add appropriate permissions for subhire
This commit is contained in:
17
RIGS/migrations/0047_alter_subhire_options.py
Normal file
17
RIGS/migrations/0047_alter_subhire_options.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Generated by Django 3.2.16 on 2022-12-16 14:22
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('RIGS', '0046_subhire'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='subhire',
|
||||
options={'permissions': [('subhire_finance', 'Can see financial data for subhire - insurance values')]},
|
||||
),
|
||||
]
|
||||
@@ -642,6 +642,11 @@ class Subhire(BaseEvent):
|
||||
def earliest_time(self):
|
||||
return find_earliest_event_time(self, [])
|
||||
|
||||
class Meta:
|
||||
permissions = [
|
||||
('subhire_finance', 'Can see financial data for subhire - insurance values')
|
||||
]
|
||||
|
||||
|
||||
class InvoiceManager(models.Manager):
|
||||
def outstanding_invoices(self):
|
||||
|
||||
@@ -40,15 +40,17 @@
|
||||
<dl class="row">
|
||||
<dt class="col-sm-6">Description</dt>
|
||||
<dd class="col-sm-6">{{ object.description }}</dd>
|
||||
{% if perms.RIGS.subhire_finance %}
|
||||
<dt class="col-sm-6">Insurance Value</dt>
|
||||
<dd class="col-sm-6">£{{ object.insurance_value }}</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-2">
|
||||
<div class="card card-default">
|
||||
<div class="card-header">Associated Events</div>
|
||||
<div class="card-header">Associated Event(s)</div>
|
||||
{% with object.events.all as events %}
|
||||
{% include 'partials/event_table.html' %}
|
||||
{%endwith%}
|
||||
|
||||
@@ -68,13 +68,13 @@ urlpatterns = [
|
||||
|
||||
|
||||
# Subhire
|
||||
path('subhire/<int:pk>/', views.SubhireDetail.as_view(),
|
||||
path('subhire/<int:pk>/', login_required(views.SubhireDetail.as_view()),
|
||||
name='subhire_detail'),
|
||||
path('subhire/create/', permission_required_with_403('RIGS.add_event')(views.SubhireCreate.as_view()),
|
||||
name='subhire_create'),
|
||||
path('subhire/<int:pk>/edit', views.SubhireEdit.as_view(),
|
||||
path('subhire/<int:pk>/edit', permission_required_with_403('RIGS.change_event')(views.SubhireEdit.as_view()),
|
||||
name='subhire_update'),
|
||||
path('subhire/upcoming', views.SubhireList.as_view(),
|
||||
path('subhire/upcoming', login_required(views.SubhireList.as_view()),
|
||||
name='subhire_list'),
|
||||
|
||||
# Dashboards
|
||||
|
||||
Reference in New Issue
Block a user