Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Hjelp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Hjelp
Commits
ab921294
Verified
Commit
ab921294
authored
3 weeks ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix and use permission for menu item
parent
79251b72
No related branches found
No related tags found
1 merge request
!166
Resolve "Check menu point permissions"
Pipeline
#196990
failed
3 weeks ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.rst
+5
-0
5 additions, 0 deletions
CHANGELOG.rst
aleksis/apps/hjelp/frontend/index.js
+1
-0
1 addition, 0 deletions
aleksis/apps/hjelp/frontend/index.js
aleksis/apps/hjelp/rules.py
+13
-12
13 additions, 12 deletions
aleksis/apps/hjelp/rules.py
with
19 additions
and
12 deletions
CHANGELOG.rst
+
5
−
0
View file @
ab921294
...
...
@@ -14,6 +14,11 @@ Added
* Menu icon changes when entry is selected.
Fixed
~~~~~
* Menu item was shown although the user had no permission to use support functions.
`3.0`_ - 2023-05-14
-------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/hjelp/frontend/index.js
+
1
−
0
View file @
ab921294
...
...
@@ -4,6 +4,7 @@ export default {
titleKey
:
"
hjelp.menu_title
"
,
icon
:
"
mdi-help-circle-outline
"
,
iconActive
:
"
mdi-help-circle
"
,
permission
:
"
hjelp.show_menu_rule
"
,
},
props
:
{
byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate
:
true
,
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/hjelp/rules.py
+
13
−
12
View file @
ab921294
...
...
@@ -2,18 +2,6 @@ from rules import add_perm
from
aleksis.core.util.predicates
import
has_global_perm
,
has_person
,
is_site_preference_set
# Show Hjelp menu
show_hjelp_menu
=
is_site_preference_set
(
"
hjelp
"
,
"
public_faq
"
)
|
(
has_person
&
(
has_global_perm
(
"
hjelp.view_faq
"
)
|
has_global_perm
(
"
hjelp.ask_faq
"
)
|
has_global_perm
(
"
hjelp.report_issue
"
)
|
has_global_perm
(
"
hjelp.send_feedback
"
)
)
)
add_perm
(
"
hjelp.show_menu_rule
"
,
show_hjelp_menu
)
# View FAQ
view_faq_predicate
=
is_site_preference_set
(
"
hjelp
"
,
"
public_faq
"
)
|
(
has_person
&
has_global_perm
(
"
hjelp.view_faq
"
)
...
...
@@ -37,3 +25,16 @@ add_perm("hjelp.report_issue_rule", report_issue_predicate)
# Add feedback
send_feedback_predicate
=
has_person
&
has_global_perm
(
"
hjelp.send_feedback
"
)
add_perm
(
"
hjelp.send_feedback_rule
"
,
send_feedback_predicate
)
# Show Hjelp menu
show_hjelp_menu
=
is_site_preference_set
(
"
hjelp
"
,
"
public_faq
"
)
|
(
has_person
&
(
view_faq_predicate
|
change_faq_predicate
|
ask_faq_predicate
|
report_issue_predicate
|
send_feedback_predicate
)
)
add_perm
(
"
hjelp.show_menu_rule
"
,
show_hjelp_menu
)
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