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
b03ce022
Commit
b03ce022
authored
Jan 16, 2023
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: test Acknowledgment local roles
parent
9c6cb6c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
39 deletions
+5
-39
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Acknowledgement.xml
...apos_erp5/PortalTypeRolesTemplateItem/Acknowledgement.xml
+2
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+3
-39
No files found.
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Acknowledgement.xml
View file @
b03ce022
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
<property
id=
'base_category_script'
>
ERP5Type_getSecurityCategoryFromContent
</property>
<property
id=
'base_category_script'
>
ERP5Type_getSecurityCategoryFromContent
</property>
<multi_property
id=
'category'
>
function/production/agent
</multi_property>
<multi_property
id=
'category'
>
function/production/agent
</multi_property>
<multi_property
id=
'base_category'
>
source_project
</multi_property>
<multi_property
id=
'base_category'
>
source_project
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
</role>
<role
id=
'Assignor'
>
<role
id=
'Assignor'
>
<property
id=
'title'
>
Source Project Production Manager
</property>
<property
id=
'title'
>
Source Project Production Manager
</property>
...
@@ -46,5 +47,6 @@
...
@@ -46,5 +47,6 @@
<property
id=
'base_category_script'
>
ERP5Type_getSecurityCategoryFromContent
</property>
<property
id=
'base_category_script'
>
ERP5Type_getSecurityCategoryFromContent
</property>
<multi_property
id=
'category'
>
function/production/manager
</multi_property>
<multi_property
id=
'category'
>
function/production/manager
</multi_property>
<multi_property
id=
'base_category'
>
source_project
</multi_property>
<multi_property
id=
'base_category'
>
source_project
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
</role>
</type_roles>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
b03ce022
...
@@ -1228,45 +1228,6 @@ class TestAccountingPeriod(TestSlapOSGroupRoleSecurityMixin):
...
@@ -1228,45 +1228,6 @@ class TestAccountingPeriod(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
product
,
'F-ACCAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
product
,
'F-ACCAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
class
TestAcknowledgement
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
product
=
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Acknowledgement'
)
product
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
product
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
product
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
def
test_SourceCustomer
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
product
=
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Acknowledgement'
,
source_value
=
person
,
)
product
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
product
,
[
'G-COMPANY'
,
person
.
getUserId
(),
self
.
user_id
],
False
)
self
.
assertRoles
(
product
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
product
,
person
.
getUserId
(),
[
'Auditor'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
def
test_DestinationCustomer
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
product
=
self
.
portal
.
event_module
.
newContent
(
portal_type
=
'Acknowledgement'
,
destination_value
=
person
,
)
product
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
product
,
[
'G-COMPANY'
,
person
.
getUserId
(),
self
.
user_id
],
False
)
self
.
assertRoles
(
product
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
product
,
person
.
getUserId
(),
[
'Auditor'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
class
TestBankAccount
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestBankAccount
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
def
test_GroupCompany
(
self
):
...
@@ -1491,6 +1452,9 @@ class TestFaxMessage(TestMailMessage):
...
@@ -1491,6 +1452,9 @@ class TestFaxMessage(TestMailMessage):
class
TestLetter
(
TestMailMessage
):
class
TestLetter
(
TestMailMessage
):
event_portal_type
=
'Letter'
event_portal_type
=
'Letter'
class
TestAcknowledgement
(
TestMailMessage
):
event_portal_type
=
'Acknowledgement'
class
TestNotificationMessageModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestNotificationMessageModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
module
=
self
.
portal
.
notification_message_module
module
=
self
.
portal
.
notification_message_module
...
...
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