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
62d9ffd1
Commit
62d9ffd1
authored
4 years ago
by
Hangzhi Yu
Browse files
Options
Downloads
Patches
Plain Diff
Use existing class for global permissions
parent
09270530
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!12
Resolve "Use permissions/rules"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/apps/hjelp/models.py
+2
-11
2 additions, 11 deletions
aleksis/apps/hjelp/models.py
aleksis/apps/hjelp/rules.py
+2
-2
2 additions, 2 deletions
aleksis/apps/hjelp/rules.py
aleksis/apps/hjelp/views.py
+1
-1
1 addition, 1 deletion
aleksis/apps/hjelp/views.py
with
5 additions
and
14 deletions
aleksis/apps/hjelp/models.py
+
2
−
11
View file @
62d9ffd1
...
...
@@ -9,10 +9,11 @@ from aleksis.core.util.model_helpers import COLOURS, ICONS
from
ckeditor.fields
import
RichTextField
class
Support
(
ExtensibleModel
):
class
HjelpGlobalPermissions
(
ExtensibleModel
):
class
Meta
:
managed
=
False
permissions
=
(
(
"
ask_faq
"
,
_
(
"
Can ask FAQ question
"
)),
(
"
report_issue
"
,
_
(
"
Can report issues
"
)),
(
"
send_feedback
"
,
_
(
"
Can send feedback
"
))
)
...
...
@@ -74,13 +75,3 @@ class IssueCategory(ExtensibleModel):
class
Meta
:
verbose_name
=
_
(
"
Bug report category
"
)
verbose_name_plural
=
_
(
"
Bug report categories
"
)
class
GlobalPermissions
(
ExtensibleModel
):
class
Meta
:
managed
=
False
permissions
=
(
(
"
ask_faq
"
,
_
(
"
Can ask FAQ question
"
)),
(
"
report_issue
"
,
_
(
"
Can report issue
"
)),
(
"
add_feedback
"
,
_
(
"
Can add feedback
"
)),
)
This diff is collapsed.
Click to expand it.
aleksis/apps/hjelp/rules.py
+
2
−
2
View file @
62d9ffd1
...
...
@@ -14,5 +14,5 @@ report_issue_predicate = has_person & has_global_perm("hjelp.report_issue")
add_perm
(
"
hjelp.report_issue
"
,
report_issue_predicate
)
# Add feedback
ad
d_feedback_predicate
=
has_person
&
has_global_perm
(
"
hjelp.
ad
d_feedback
"
)
add_perm
(
"
hjelp.
ad
d_feedback
"
,
ad
d_feedback_predicate
)
sen
d_feedback_predicate
=
has_person
&
has_global_perm
(
"
hjelp.
sen
d_feedback
"
)
add_perm
(
"
hjelp.
sen
d_feedback
"
,
sen
d_feedback_predicate
)
This diff is collapsed.
Click to expand it.
aleksis/apps/hjelp/views.py
+
1
−
1
View file @
62d9ffd1
...
...
@@ -131,7 +131,7 @@ def rebus(request):
)
@permission_required
(
"
hjelp.
ad
d_feedback
"
)
@permission_required
(
"
hjelp.
sen
d_feedback
"
)
def
feedback
(
request
):
if
request
.
method
==
"
POST
"
:
form
=
FeedbackForm
(
request
.
POST
)
...
...
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