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
0
Merge Requests
0
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
Nicolas Wavrant
slapos.core
Commits
7a4811b8
Commit
7a4811b8
authored
Dec 17, 2019
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: Add TestWechatEvent on testSlapOSERP5GroupRoleSecurity
parent
0fe81d86
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
12 deletions
+39
-12
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+39
-12
No files found.
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
7a4811b8
...
...
@@ -2068,30 +2068,57 @@ class TestSystemEventModule(TestSlapOSGroupRoleSecurityMixin):
class
TestPayzenEvent
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
produc
t
=
self
.
portal
.
system_event_module
.
newContent
(
even
t
=
self
.
portal
.
system_event_module
.
newContent
(
portal_type
=
'Payzen Event'
)
produc
t
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
produc
t
,
even
t
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
even
t
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
produc
t
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
produc
t
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
even
t
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
even
t
,
self
.
user_id
,
[
'Owner'
])
def
test_ShadowUser
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
produc
t
=
self
.
portal
.
system_event_module
.
newContent
(
even
t
=
self
.
portal
.
system_event_module
.
newContent
(
portal_type
=
'Payzen Event'
)
produc
t
.
edit
(
even
t
.
edit
(
destination_section_value
=
person
,
)
produc
t
.
updateLocalRolesOnSecurityGroups
()
even
t
.
updateLocalRolesOnSecurityGroups
()
shadow_user_id
=
'SHADOW-%s'
%
person
.
getUserId
()
self
.
assertSecurityGroup
(
produc
t
,
self
.
assertSecurityGroup
(
even
t
,
[
'G-COMPANY'
,
self
.
user_id
,
shadow_user_id
],
False
)
self
.
assertRoles
(
product
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
product
,
shadow_user_id
,
[
'Assignee'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
event
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
event
,
shadow_user_id
,
[
'Assignee'
])
self
.
assertRoles
(
event
,
self
.
user_id
,
[
'Owner'
])
class
TestWechatEvent
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
event
=
self
.
portal
.
system_event_module
.
newContent
(
portal_type
=
'Wechat Event'
)
event
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
event
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
event
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
event
,
self
.
user_id
,
[
'Owner'
])
def
test_ShadowUser
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
event
=
self
.
portal
.
system_event_module
.
newContent
(
portal_type
=
'Wechat Event'
)
event
.
edit
(
destination_section_value
=
person
,
)
event
.
updateLocalRolesOnSecurityGroups
()
shadow_user_id
=
'SHADOW-%s'
%
person
.
getUserId
()
self
.
assertSecurityGroup
(
event
,
[
'G-COMPANY'
,
self
.
user_id
,
shadow_user_id
],
False
)
self
.
assertRoles
(
event
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
event
,
shadow_user_id
,
[
'Assignee'
])
self
.
assertRoles
(
event
,
self
.
user_id
,
[
'Owner'
])
class
TestSecurePaymentTool
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_no_permissions_for_users
(
self
):
...
...
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