Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Tezor
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
Package 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
Show more breadcrumbs
AlekSIS®
Onboarding
AlekSIS-App-Tezor
Merge requests
!6
Add rules
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add rules
rules
into
master
Overview
4
Commits
4
Pipelines
6
Changes
2
2 unresolved threads
Hide all comments
Merged
Tom Teichler
requested to merge
rules
into
master
3 years ago
Overview
4
Commits
4
Pipelines
6
Changes
1
2 unresolved threads
Hide all comments
Expand
0
0
Merge request reports
Compare
version 1
version 5
4d30e080
3 years ago
version 4
92b04d83
3 years ago
version 3
d5456bfc
3 years ago
version 2
1085f5f9
3 years ago
version 1
f98412c7
3 years ago
master (base)
and
version 2
latest version
a1f7091c
4 commits,
3 years ago
version 5
4d30e080
3 commits,
3 years ago
version 4
92b04d83
2 commits,
3 years ago
version 3
d5456bfc
2 commits,
3 years ago
version 2
1085f5f9
1 commit,
3 years ago
version 1
f98412c7
1 commit,
3 years ago
Show latest version
1 file
+
8
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
aleksis/apps/tezor/rules.py
+
8
−
8
Options
@@ -29,48 +29,48 @@ rules.add_perm("tezor.delete_clients_rule", delete_clients_predicate)
# View invoice groups
view_invoice_groups_predicate
=
has_person
&
(
has_global_perm
(
"
tezor.view_invoice_group
"
)
|
has_any_object
(
"
tezor.view_invoice_group
"
,
Client
)
has_global_perm
(
"
tezor.view_invoice_group
"
)
|
has_any_object
(
"
tezor.view_invoice_group
"
,
InvoiceGroup
)
)
rules
.
add_perm
(
"
tezor.view_invoice_groups_rule
"
,
view_invoice_groups_predicate
)
# Edit invoice groups
edit_invoice_groups_predicate
=
has_person
&
(
has_global_perm
(
"
tezor.edit_invoice_group
"
)
|
has_any_object
(
"
tezor.edit_invoice_group
"
,
Client
)
has_global_perm
(
"
tezor.edit_invoice_group
"
)
|
has_any_object
(
"
tezor.edit_invoice_group
"
,
InvoiceGroup
)
)
rules
.
add_perm
(
"
tezor.edit_invoice_groups_rule
"
,
edit_invoice_groups_predicate
)
# Create invoice groups
create_invoice_groups_predicate
=
has_person
&
(
has_global_perm
(
"
tezor.create_invoice_group
"
)
|
has_any_object
(
"
tezor.create_invoice_group
"
,
Client
)
has_global_perm
(
"
tezor.create_invoice_group
"
)
|
has_any_object
(
"
tezor.create_invoice_group
"
,
InvoiceGroup
)
)
rules
.
add_perm
(
"
tezor.create_invoice_groups_rule
"
,
create_invoice_groups_predicate
)
# Delete invoice groups
delete_invoice_groups_predicate
=
has_person
&
(
has_global_perm
(
"
tezor.delete_invoice_group
"
)
|
has_any_object
(
"
tezor.delete_invoice_group
"
,
Client
)
has_global_perm
(
"
tezor.delete_invoice_group
"
)
|
has_any_object
(
"
tezor.delete_invoice_group
"
,
InvoiceGroup
)
)
rules
.
add_perm
(
"
tezor.delete_invoice_groups_rule
"
,
delete_invoice_groups_predicate
)
# View invoices
view_invoices_predicate
=
has_person
&
(
has_global_perm
(
"
tezor.view_invoice
"
)
|
has_any_object
(
"
tezor.view_invoice
"
,
Client
)
has_global_perm
(
"
tezor.view_invoice
"
)
|
has_any_object
(
"
tezor.view_invoice
"
,
Invoice
)
)
rules
.
add_perm
(
"
tezor.view_invoices_rule
"
,
view_invoices_predicate
)
# Edit invoices
edit_invoices_predicate
=
has_person
&
(
has_global_perm
(
"
tezor.edit_invoice
"
)
|
has_any_object
(
"
tezor.edit_invoice
"
,
Client
)
has_global_perm
(
"
tezor.edit_invoice
"
)
|
has_any_object
(
"
tezor.edit_invoice
"
,
Invoice
)
)
rules
.
add_perm
(
"
tezor.edit_invoices_rule
"
,
edit_invoices_predicate
)
# Create invoices
create_invoices_predicate
=
has_person
&
(
has_global_perm
(
"
tezor.create_invoice
"
)
|
has_any_object
(
"
tezor.create_invoice
"
,
Client
)
has_global_perm
(
"
tezor.create_invoice
"
)
|
has_any_object
(
"
tezor.create_invoice
"
,
Invoice
)
)
rules
.
add_perm
(
"
tezor.create_invoices_rule
"
,
create_invoices_predicate
)
# Delete invoices
delete_invoices_predicate
=
has_person
&
(
has_global_perm
(
"
tezor.delete_invoice
"
)
|
has_any_object
(
"
tezor.delete_invoice
"
,
Client
)
has_global_perm
(
"
tezor.delete_invoice
"
)
|
has_any_object
(
"
tezor.delete_invoice
"
,
Invoice
)
)
rules
.
add_perm
(
"
tezor.delete_invoices_rule
"
,
delete_invoices_predicate
)
Loading