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
eecc3b65
Verified
Commit
eecc3b65
authored
9 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
feat: add permissions to edit Host email, image & owners fields
parent
2d22b865
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/0097_alter_host_options.py
+27
-0
27 additions, 0 deletions
program/migrations/0097_alter_host_options.py
program/models.py
+5
-2
5 additions, 2 deletions
program/models.py
with
32 additions
and
2 deletions
program/migrations/0097_alter_host_options.py
0 → 100644
+
27
−
0
View file @
eecc3b65
# Generated by Django 4.2.13 on 2024-06-11 19:02
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
"
program
"
,
"
0096_alter_category_description_alter_category_is_active_and_more
"
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
"
host
"
,
options
=
{
"
ordering
"
:
(
"
name
"
,),
"
permissions
"
:
[
(
"
edit__host__biography
"
,
"
Can edit biography field
"
),
(
"
edit__host__email
"
,
"
Can edit email field
"
),
(
"
edit__host__image
"
,
"
Can edit image field
"
),
(
"
edit__host__name
"
,
"
Can edit name field
"
),
(
"
edit__host__owners
"
,
"
Can edit owners field
"
),
(
"
update_host
"
,
"
Can update host
"
),
],
},
),
]
This diff is collapsed.
Click to expand it.
program/models.py
+
5
−
2
View file @
eecc3b65
...
@@ -180,8 +180,11 @@ class Host(models.Model):
...
@@ -180,8 +180,11 @@ class Host(models.Model):
class
Meta
:
class
Meta
:
ordering
=
(
"
name
"
,)
ordering
=
(
"
name
"
,)
permissions
=
[
permissions
=
[
(
"
edit__host__biography
"
,
"
Can edit Host biography field
"
),
(
"
edit__host__biography
"
,
"
Can edit biography field
"
),
(
"
edit__host__name
"
,
"
Can edit Host name field
"
),
(
"
edit__host__email
"
,
"
Can edit email field
"
),
(
"
edit__host__image
"
,
"
Can edit image field
"
),
(
"
edit__host__name
"
,
"
Can edit name field
"
),
(
"
edit__host__owners
"
,
"
Can edit owners field
"
),
# overrides ownership
# overrides ownership
(
"
update_host
"
,
"
Can update host
"
),
(
"
update_host
"
,
"
Can update host
"
),
]
]
...
...
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