Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
69c211aa
Commit
69c211aa
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '395-preference-dashboard-editing' into 'master'
Add preference to enable/disable dashboard editing Closes
#395
See merge request
!507
parents
2621edcd
1a676cbb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!507
Add preference to enable/disable dashboard editing
Pipeline
#6165
passed
4 years ago
Stage: test
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/core/preferences.py
+9
-0
9 additions, 0 deletions
aleksis/core/preferences.py
aleksis/core/rules.py
+1
-1
1 addition, 1 deletion
aleksis/core/rules.py
with
10 additions
and
1 deletion
aleksis/core/preferences.py
+
9
−
0
View file @
69c211aa
...
...
@@ -261,3 +261,12 @@ class AnonymousDashboard(BooleanPreference):
default
=
False
required
=
False
verbose_name
=
_
(
"
Show dashboard to users without login
"
)
@site_preferences_registry.register
class
DashboardEditing
(
BooleanPreference
):
section
=
general
name
=
"
dashboard_editing
"
default
=
True
required
=
False
verbose_name
=
_
(
"
Allow users to edit their dashboard
"
)
This diff is collapsed.
Click to expand it.
aleksis/core/rules.py
+
1
−
1
View file @
69c211aa
...
...
@@ -312,7 +312,7 @@ rules.add_perm("core.edit_dashboardwidget", edit_dashboard_widget_predicate)
delete_dashboard_widget_predicate
=
has_person
&
has_global_perm
(
"
core.delete_dashboardwidget
"
)
rules
.
add_perm
(
"
core.delete_dashboardwidget
"
,
delete_dashboard_widget_predicate
)
edit_dashboard_predicate
=
has_person
edit_dashboard_predicate
=
is_site_preference_set
(
"
general
"
,
"
dashboard_editing
"
)
&
has_person
rules
.
add_perm
(
"
core.edit_dashboard
"
,
edit_dashboard_predicate
)
edit_default_dashboard_predicate
=
has_person
&
has_global_perm
(
"
core.edit_default_dashboard
"
)
...
...
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