mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Fixed asset permissions
This commit is contained in:
21
assets/migrations/0014_auto_20191017_2052.py
Normal file
21
assets/migrations/0014_auto_20191017_2052.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Generated by Django 2.0.13 on 2019-10-17 19:52
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('assets', '0013_auto_20191016_1446'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='asset',
|
||||
options={'ordering': ['asset_id'], 'permissions': (('asset_finance', 'Can see financial data for assets'), ('view_asset', 'Can view an asset'))},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='supplier',
|
||||
options={'permissions': (('view_supplier', 'Can view a supplier'),)},
|
||||
),
|
||||
]
|
||||
@@ -33,6 +33,12 @@ class AssetStatus(models.Model):
|
||||
class Supplier(models.Model):
|
||||
name = models.CharField(max_length=80)
|
||||
|
||||
|
||||
class Meta:
|
||||
permissions = (
|
||||
('view_supplier', 'Can view a supplier'),
|
||||
)
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse('supplier_list')
|
||||
|
||||
@@ -55,6 +61,7 @@ class Asset(models.Model):
|
||||
ordering = ['asset_id']
|
||||
permissions = (
|
||||
('asset_finance', 'Can see financial data for assets'),
|
||||
('view_asset', 'Can view an asset')
|
||||
)
|
||||
|
||||
parent = models.ForeignKey(to='self', related_name='asset_parent', blank=True, null=True, on_delete=models.SET_NULL)
|
||||
|
||||
Reference in New Issue
Block a user