Skip to content
Snippets Groups Projects
Verified Commit 1c1017d9 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: add field level permissions for Host, Note, Show and Timeslot

parent 9d565fb7
No related branches found
No related tags found
No related merge requests found
# Generated by Django 4.2.10 on 2024-02-14 01:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("program", "0079_alter_show_slug"),
]
operations = [
migrations.AlterModelOptions(
name="note",
options={
"ordering": ("timeslot",),
"permissions": [
("edit__note__content", "Can edit content field"),
("edit__note__contributors", "Can edit contributor field"),
("edit__note__image", "Can edit image field"),
("edit__note__languages", "Can edit language field"),
("edit__note__links", "Can edit links field"),
("edit__note__summary", "Can edit summary field"),
("edit__note__tags", "Can edit tags field"),
("edit__note__title", "Can edit title field"),
("edit__note__topics", "Can edit topics field"),
],
},
),
migrations.AlterModelOptions(
name="show",
options={
"ordering": ("slug",),
"permissions": [
("display__show__internal_note", "Can display internal note field"),
("edit__show__categories", "Can edit category field"),
("edit__show__cba_series_id", "Can edit cba series id field"),
("edit__show__default_playlist", "Can edit default playlist id field"),
("edit__show__description", "Can edit description field"),
("edit__show__email", "Can edit email field"),
("edit__show__funding_categories", "Can edit funding category field"),
("edit__show__hosts", "Can edit hosts field"),
("edit__show__image", "Can edit image field"),
("edit__show__internal_note", "Can edit internal note field"),
("edit__show__is_active", "Can edit is active field"),
("edit__show__languages", "Can edit language field"),
("edit__show__links", "Can edit links field"),
("edit__show__logo", "Can edit logo field"),
("edit__show__music_focuses", "Can edit music focus field"),
("edit__show__name", "Can edit name field"),
("edit__show__owners", "Can edit owners field"),
("edit__show__predecessor", "Can edit predecessor field"),
("edit__show__short_description", "Can edit short_description field"),
("edit__show__slug", "Can edit slug field"),
("edit__show__topics", "Can edit topic field"),
("edit__show__type", "Can edit type field"),
],
},
),
migrations.AlterModelOptions(
name="timeslot",
options={
"ordering": ("start", "end"),
"permissions": [("edit__timeslot__playlist", "Can edit playlist field")],
},
),
]
......@@ -256,9 +256,28 @@ class Show(models.Model):
class Meta:
ordering = ("slug",)
permissions = [
("edit__show__description", "Can edit Show description field"),
("edit__show__name", "Can edit Show name field"),
("edit__show__short_description", "Can edit Show short_description field"),
("display__show__internal_note", "Can display internal note field"),
("edit__show__categories", "Can edit category field"),
("edit__show__cba_series_id", "Can edit cba series id field"),
("edit__show__default_playlist", "Can edit default playlist id field"),
("edit__show__description", "Can edit description field"),
("edit__show__email", "Can edit email field"),
("edit__show__funding_categories", "Can edit funding category field"),
("edit__show__hosts", "Can edit hosts field"),
("edit__show__image", "Can edit image field"),
("edit__show__internal_note", "Can edit internal note field"),
("edit__show__is_active", "Can edit is active field"),
("edit__show__languages", "Can edit language field"),
("edit__show__links", "Can edit links field"),
("edit__show__logo", "Can edit logo field"),
("edit__show__music_focuses", "Can edit music focus field"),
("edit__show__name", "Can edit name field"),
("edit__show__owners", "Can edit owners field"),
("edit__show__predecessor", "Can edit predecessor field"),
("edit__show__short_description", "Can edit short_description field"),
("edit__show__slug", "Can edit slug field"),
("edit__show__topics", "Can edit topic field"),
("edit__show__type", "Can edit type field"),
]
def __str__(self):
......@@ -411,6 +430,7 @@ class TimeSlot(models.Model):
class Meta:
ordering = ("start", "end")
permissions = [("edit__timeslot__playlist", "Can edit playlist field")]
def __str__(self):
if self.start.date() == self.end.date():
......@@ -461,8 +481,15 @@ class Note(models.Model):
class Meta:
ordering = ("timeslot",)
permissions = [
("edit__note__language", "Can edit Note language field"),
("edit__note__topic", "Can edit Note topic field"),
("edit__note__content", "Can edit content field"),
("edit__note__contributors", "Can edit contributor field"),
("edit__note__image", "Can edit image field"),
("edit__note__languages", "Can edit language field"),
("edit__note__links", "Can edit links field"),
("edit__note__summary", "Can edit summary field"),
("edit__note__tags", "Can edit tags field"),
("edit__note__title", "Can edit title field"),
("edit__note__topics", "Can edit topics field"),
]
def __str__(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment