Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TIC-Desk
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
Environments
Terraform modules
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Teckids
TIC-Desk
Commits
d5de6b13
Commit
d5de6b13
authored
4 years ago
by
Tom Teichler
Committed by
root
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add rules
parent
90aa5833
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!55
WIP: Resolve "Migrate to AlekSIS app"
Pipeline
#3822
failed
4 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/ticdesk/predicates.py
+7
-0
7 additions, 0 deletions
aleksis/apps/ticdesk/predicates.py
aleksis/apps/ticdesk/rules.py
+2
-2
2 additions, 2 deletions
aleksis/apps/ticdesk/rules.py
with
9 additions
and
2 deletions
aleksis/apps/ticdesk/predicates.py
+
7
−
0
View file @
d5de6b13
...
...
@@ -31,3 +31,10 @@ def is_own_voucher(user: User, voucher: Voucher) -> bool:
"""
Predicate which checks if the voucher belongs to the user.
"""
return
voucher
.
person
==
user
.
person
@predicate
def
is_own_registration
(
user
:
User
,
registration
:
Registration
)
->
bool
:
"""
Predicate which checks if the registration belongs to the user.
""""
return registration.person == user.person
This diff is collapsed.
Click to expand it.
aleksis/apps/ticdesk/rules.py
+
2
−
2
View file @
d5de6b13
...
...
@@ -11,11 +11,10 @@ from aleksis.core.util.predicates import (
from
.models
import
EventRegistration
,
FeedbackAspect
,
TeckidsMember
,
TeckidsEvent
,
Voucher
from
.predicates
import
(
is_own_pgp_key
,
is_own_ssh_key
,
is_own_voucher
,
see_group_by_grouptype
,
see_owned_groups_members
,
is_own_registration
,
)
# View vouchers
...
...
@@ -91,6 +90,7 @@ add_perm("ticdesk.view_registrations", view_registrations_predicate)
# Manage registrations
manage_registrations_predicate
=
has_person
&
(
has_global_perm
(
"
ticdesk.manage_registrations
"
)
|
is_own_registration
|
has_any_object
(
"
ticdesk.manage_registrations
"
,
EventRegistration
)
)
add_perm
(
"
ticdesk.manage_registrations
"
,
manage_registrations_predicate
)
...
...
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