Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
1c1017d9
Verified
Commit
1c1017d9
authored
1 year ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
program/migrations/0080_alter_note_options_alter_show_options_and_more.py
+66
-0
66 additions, 0 deletions
...ns/0080_alter_note_options_alter_show_options_and_more.py
program/models.py
+32
-5
32 additions, 5 deletions
program/models.py
with
98 additions
and
5 deletions
program/migrations/0080_alter_note_options_alter_show_options_and_more.py
0 → 100644
+
66
−
0
View file @
1c1017d9
# 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
"
)],
},
),
]
This diff is collapsed.
Click to expand it.
program/models.py
+
32
−
5
View file @
1c1017d9
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment