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
78616770
Verified
Commit
78616770
authored
1 year ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
feat: add permissions and groups
parent
043965d2
No related branches found
No related tags found
1 merge request
!29
Use docker main tag
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
program/migrations/0076_add_permissions_and_groups.py
+47
-0
47 additions, 0 deletions
program/migrations/0076_add_permissions_and_groups.py
program/models.py
+14
-0
14 additions, 0 deletions
program/models.py
with
61 additions
and
0 deletions
program/migrations/0076_add_permissions_and_groups.py
0 → 100644
+
47
−
0
View file @
78616770
# Generated by Django 4.2.6 on 2023-12-07 20:29
from
django.db
import
migrations
def
add_groups
(
apps
,
_
):
Group
=
apps
.
get_model
(
"
auth
"
,
"
Group
"
)
Group
.
objects
.
get_or_create
(
name
=
"
Program
"
)
Group
.
objects
.
get_or_create
(
name
=
"
Broadcast
"
)
Group
.
objects
.
get_or_create
(
name
=
"
BroadcastPlus
"
)
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"
program
"
,
"
0075_remove_timeslot_language_remove_timeslot_topic_and_more
"
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
"
host
"
,
options
=
{
"
ordering
"
:
(
"
name
"
,),
"
permissions
"
:
[
(
"
change_biography
"
,
"
Can change biography
"
),
(
"
change_email
"
,
"
Can change email
"
),
(
"
change_image
"
,
"
Can change image
"
),
(
"
change_name
"
,
"
Can change name
"
),
],
},
),
migrations
.
AlterModelOptions
(
name
=
"
show
"
,
options
=
{
"
ordering
"
:
(
"
slug
"
,),
"
permissions
"
:
[
(
"
change_description
"
,
"
Can change description
"
),
(
"
change_email
"
,
"
Can change email
"
),
(
"
change_image
"
,
"
Can change image
"
),
(
"
change_logo
"
,
"
Can change logo
"
),
(
"
change_name
"
,
"
Can change name
"
),
(
"
change_short_description
"
,
"
Can change short_description
"
),
],
},
),
migrations
.
RunPython
(
code
=
add_groups
),
]
This diff is collapsed.
Click to expand it.
program/models.py
+
14
−
0
View file @
78616770
...
...
@@ -173,6 +173,12 @@ class Host(models.Model):
class
Meta
:
ordering
=
(
"
name
"
,)
permissions
=
[
(
"
change_biography
"
,
"
Can change biography
"
),
(
"
change_email
"
,
"
Can change email
"
),
(
"
change_image
"
,
"
Can change image
"
),
(
"
change_name
"
,
"
Can change name
"
),
]
def
__str__
(
self
):
return
self
.
name
...
...
@@ -251,6 +257,14 @@ class Show(models.Model):
class
Meta
:
ordering
=
(
"
slug
"
,)
permissions
=
[
(
"
change_description
"
,
"
Can change description
"
),
(
"
change_email
"
,
"
Can change email
"
),
(
"
change_image
"
,
"
Can change image
"
),
(
"
change_logo
"
,
"
Can change logo
"
),
(
"
change_name
"
,
"
Can change name
"
),
(
"
change_short_description
"
,
"
Can change short_description
"
),
]
def
__str__
(
self
):
return
self
.
name
...
...
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