Skip to content
Snippets Groups Projects
Commit b4cee807 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Adding superevent GOP perms and is_exposed field

Adding permissions for viewing GOPs attached to a superevent and
the is_exposed field, which will track whether a superevent is
exposed to the public or not.
parent 11c2a9c5
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-08-14 15:31
# Generated by Django 1.11.14 on 2018-08-30 17:44
from __future__ import unicode_literals
import core.models
......@@ -114,6 +114,9 @@ class Migration(migrations.Migration):
('signoff_type', models.CharField(choices=[(b'OP', b'operator'), (b'ADV', b'advocate')], max_length=3)),
('submitter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='superevents_signoff_set', to=settings.AUTH_USER_MODEL)),
],
options={
'permissions': (('view_signoff', 'Can view signoff'), ('do_H1_signoff', 'Can interact with H1 signoffs'), ('do_L1_signoff', 'Can interact with L1 signoffs'), ('do_V1_signoff', 'Can interact with V1 signoffs'), ('do_adv_signoff', 'Can interact with advocate signoffs')),
},
),
migrations.CreateModel(
name='Superevent',
......@@ -130,6 +133,7 @@ class Migration(migrations.Migration):
('gw_date_number', models.PositiveIntegerField(editable=False, null=True)),
('gw_letter_suffix', models.CharField(editable=False, max_length=10, null=True)),
('is_gw', models.BooleanField(default=False)),
('is_exposed', models.BooleanField(default=False)),
('labels', models.ManyToManyField(through='superevents.Labelling', to='events.Label')),
('preferred_event', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='superevent_preferred_for', to='events.Event')),
('submitter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
......@@ -150,6 +154,7 @@ class Migration(migrations.Migration):
],
options={
'abstract': False,
'permissions': (('view_supereventgroupobjectpermission', 'Can view superevent groupobjectpermission'),),
},
),
migrations.CreateModel(
......
......@@ -108,6 +108,9 @@ class Superevent(CleanSaveModel, ModelToDictMixin, AutoIncrementModel):
# Booleans
is_gw = models.BooleanField(default=False)
# Because there are multiple actions/permissions involved with exposing a
# superevent, we are going to use a database field to track it.
is_exposed = models.BooleanField(default=False)
# Meta class --------------------------------------------------------------
class Meta:
......@@ -440,6 +443,12 @@ class Superevent(CleanSaveModel, ModelToDictMixin, AutoIncrementModel):
class SupereventGroupObjectPermission(GroupObjectPermissionBase):
content_object = models.ForeignKey(Superevent, on_delete=models.CASCADE)
class Meta(GroupObjectPermissionBase.Meta):
permissions = (
('view_supereventgroupobjectpermission',
'Can view superevent groupobjectpermission'),
)
class SupereventUserObjectPermission(UserObjectPermissionBase):
content_object = models.ForeignKey(Superevent, on_delete=models.CASCADE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment