Commit 5a2aec12 authored by Gabriel Monnerat's avatar Gabriel Monnerat

2011-03-01 gabriel

* Add roles to allow erp5 user manage events in Event Module

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43869 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 45e8dc48
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Assignor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>UNG User</property>
<multi_property id='category'>function/ung_user</multi_property>
<multi_property id='base_category'>function</multi_property>
</role>
</type_roles>
\ No newline at end of file
......@@ -64,6 +64,12 @@ class TestUNGSecurity(ERP5TypeTestCase):
'erp5_web_ung_theme',
'erp5_web_ung_role')
def beforeTearDown(self):
""" """
person_module = self.getPersonModule()
person_module.manage_delObjects(list(person_module.objectIds()))
self.stepTic()
def testERP5Site_createNewWebDocumentAsAnonymous(self):
"""Test use script ERP5Site_createNewWebDocument as Anonymous User"""
self.logout()
......@@ -84,8 +90,53 @@ class TestUNGSecurity(ERP5TypeTestCase):
self.login("ung_user")
web_page = self.portal.portal_catalog.getResultValue(portal_type="Web Page")
self.assertEquals(web_page, None)
web_page = self.portal.ERP5Site_createNewWebDocument("web_page_template")
self.portal.ERP5Site_createNewWebDocument("web_page_template")
self.stepTic()
web_page = self.portal.portal_catalog.getResultValue(portal_type="Web Page")
self.assertEquals(web_page.getReference(), "default-Web.Page.Reference")
self.assertEquals(len(self.portal.web_page_module.searchFolder()), 1)
\ No newline at end of file
self.assertEquals(len(self.portal.web_page_module.searchFolder()), 1)
def testShareDocument(self):
"""Test the document sharing between erp5 users"""
person = self.portal.person_module.newContent(portal_type='Person',
reference="ung_user")
assignment = person.newContent(portal_type='Assignment')
assignment.setFunction("function/ung_user")
assignment.open()
person = self.portal.person_module.newContent(portal_type='Person',
reference="ung_user2",
first_name="Gabriel")
assignment = person.newContent(portal_type='Assignment')
assignment.setFunction("function/ung_user")
assignment.open()
self.stepTic()
self.login("ung_user")
self.portal.ERP5Site_createNewWebDocument("web_table_template")
self.stepTic()
web_table = self.portal.portal_catalog.getResultValue(portal_type="Web Table")
web_table.setReference("share-Web.Table")
self.stepTic()
self.login("ung_user2")
self.assertEquals(len(self.portal.web_page_module.searchFolder()), 0)
ung_web_site = self.portal.web_site_module.ung
web_table = ung_web_site.WebSection_userFollowUpWebPage("share-Web.Table")
self.assertNotEquals(web_table.getFollowUpList(), [])
self.login("ERP5TypeTestCase")
self.assertEquals(web_table.getFollowUpValue().getFirstName(), "Gabriel")
def testBase_updateCalendarEventListWithERP5User(self):
""" """
person = self.portal.person_module.newContent(portal_type='Person',
reference="ung_user")
assignment = person.newContent(portal_type='Assignment')
assignment.setFunction("function/ung_user")
assignment.open()
self.stepTic()
self.logout()
self.assertRaises(Unauthorized,
self.portal.Base_updateCalendarEventList,
("list"))
self.login("ung_user")
event_list = self.portal.Base_updateCalendarEventList("list")
self.assertEquals(event_list, [])
\ No newline at end of file
2011-03-01 gabriel
* Add roles to allow erp5 user manage events in Event Module
* Initial commit to testUNGSecurity
2010-12-27 gabriel
......
12
\ No newline at end of file
13
\ No newline at end of file
Acknowledgement
Contribution Tool
Document Module
Event Module
Fax Message
Knowledge Pad Module
Letter
Mail Message
Note
Person
Person Module
Phone Call
Short Message
Site Message
Spreadsheet
Text
Visit
Web Illustration
Web Message
Web Page
Web Page Module
Web Table
\ No newline at end of file
......@@ -8,4 +8,15 @@ Text
Web Illustration
Web Page
Web Page Module
Web Table
\ No newline at end of file
Web Table
Event Module
Acknowledgement
Fax Message
Letter
Mail Message
Note
Phone Call
Short Message
Site Message
Visit
Web Message
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment