Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
c30e558f
Commit
c30e558f
authored
Oct 30, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: test Sale Trade Condition local roles
parent
2f2bad3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
1 deletion
+106
-1
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+106
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
c30e558f
...
...
@@ -1414,7 +1414,6 @@ class TestOpenSaleOrder(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
delivery
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
def
test_OpenSaleOrder_user
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
...
...
@@ -1452,3 +1451,109 @@ class TestOpenSaleOrder(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
delivery
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
class
TestSaleTradeConditionModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_SaleTradeConditionModule
(
self
):
module
=
self
.
portal
.
sale_trade_condition_module
self
.
assertSecurityGroup
(
module
,
[
'F-SALE*'
,
'F-ACCOUNTING*'
,
'F-CUSTOMER'
,
'R-SHADOW-PERSON'
,
module
.
Base_getOwnerId
()],
False
)
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-CUSTOMER'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
class
TestSaleTradeCondition
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_SaleTradeCondition_default
(
self
):
delivery
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
'Sale Trade Condition'
)
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALEAGT'
,
'F-SALEMAN'
,
'F-ACCOUNTING*'
,
'R-SHADOW-PERSON'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALEAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
delivery
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
def
test_SaleTradeCondition_allUsers
(
self
):
delivery
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
'Sale Trade Condition'
)
delivery
.
validate
()
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALEAGT'
,
'F-SALEMAN'
,
'F-ACCOUNTING*'
,
'R-SHADOW-PERSON'
,
'F-CUSTOMER'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALEAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
delivery
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-CUSTOMER'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
delivery
.
invalidate
()
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALEAGT'
,
'F-SALEMAN'
,
'F-ACCOUNTING*'
,
'R-SHADOW-PERSON'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALEAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
delivery
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
def
test_SaleTradeCondition_singleUser
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
delivery
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
'Sale Trade Condition'
)
delivery
.
validate
()
delivery
.
edit
(
destination_value
=
person
)
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALEAGT'
,
'F-SALEMAN'
,
'F-ACCOUNTING*'
,
'R-SHADOW-PERSON'
,
self
.
user_id
,
person
.
getUserId
()],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALEAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
delivery
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
person
.
getUserId
(),
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
delivery
.
invalidate
()
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALEAGT'
,
'F-SALEMAN'
,
'F-ACCOUNTING*'
,
'R-SHADOW-PERSON'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALEAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
delivery
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
def
test_SaleTradeCondition_project
(
self
):
project
=
self
.
portal
.
project_module
.
newContent
(
portal_type
=
'Project'
)
delivery
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
'Sale Trade Condition'
)
delivery
.
validate
()
delivery
.
edit
(
destination_project_value
=
project
)
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALEAGT'
,
'F-SALEMAN'
,
'F-ACCOUNTING*'
,
'R-SHADOW-PERSON'
,
self
.
user_id
,
project
.
getReference
()],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALEAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
delivery
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
project
.
getReference
(),
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
delivery
.
invalidate
()
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALEAGT'
,
'F-SALEMAN'
,
'F-ACCOUNTING*'
,
'R-SHADOW-PERSON'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALEAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
delivery
,
'F-SALEMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment