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
fe6a0a88
Commit
fe6a0a88
authored
3 weeks ago
by
Jonathan Weth
Browse files
Options
Downloads
Plain Diff
Merge branch '54-check-menu-point-permissions' into 'master'
Resolve "Check menu point permissions" Closes
#54
See merge request
!166
parents
79251b72
ab921294
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!166
Resolve "Check menu point permissions"
Pipeline
#196991
failed
3 weeks ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: deploy
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 @
fe6a0a88
...
@@ -14,6 +14,11 @@ Added
...
@@ -14,6 +14,11 @@ Added
* Menu icon changes when entry is selected.
* 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
`3.0`_ - 2023-05-14
-------------------
-------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/hjelp/frontend/index.js
+
1
−
0
View file @
fe6a0a88
...
@@ -4,6 +4,7 @@ export default {
...
@@ -4,6 +4,7 @@ export default {
titleKey
:
"
hjelp.menu_title
"
,
titleKey
:
"
hjelp.menu_title
"
,
icon
:
"
mdi-help-circle-outline
"
,
icon
:
"
mdi-help-circle-outline
"
,
iconActive
:
"
mdi-help-circle
"
,
iconActive
:
"
mdi-help-circle
"
,
permission
:
"
hjelp.show_menu_rule
"
,
},
},
props
:
{
props
:
{
byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate
:
true
,
byTheGreatnessOfTheAlmightyAleksolotlISwearIAmWorthyOfUsingTheLegacyBaseTemplate
:
true
,
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/hjelp/rules.py
+
13
−
12
View file @
fe6a0a88
...
@@ -2,18 +2,6 @@ from rules import add_perm
...
@@ -2,18 +2,6 @@ from rules import add_perm
from
aleksis.core.util.predicates
import
has_global_perm
,
has_person
,
is_site_preference_set
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
view_faq_predicate
=
is_site_preference_set
(
"
hjelp
"
,
"
public_faq
"
)
|
(
view_faq_predicate
=
is_site_preference_set
(
"
hjelp
"
,
"
public_faq
"
)
|
(
has_person
&
has_global_perm
(
"
hjelp.view_faq
"
)
has_person
&
has_global_perm
(
"
hjelp.view_faq
"
)
...
@@ -37,3 +25,16 @@ add_perm("hjelp.report_issue_rule", report_issue_predicate)
...
@@ -37,3 +25,16 @@ add_perm("hjelp.report_issue_rule", report_issue_predicate)
# Add feedback
# Add feedback
send_feedback_predicate
=
has_person
&
has_global_perm
(
"
hjelp.send_feedback
"
)
send_feedback_predicate
=
has_person
&
has_global_perm
(
"
hjelp.send_feedback
"
)
add_perm
(
"
hjelp.send_feedback_rule
"
,
send_feedback_predicate
)
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