Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
144
Merge Requests
144
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
0f043a4a
Commit
0f043a4a
authored
Nov 10, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_base: add a post_upgrade constraint in Template Tool to setup ERP5LoginUserManager if missing.
parent
fdeead9f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
241 additions
and
3 deletions
+241
-3
bt5/erp5_base/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+3
-0
bt5/erp5_base/PropertySheetTemplateItem/portal_property_sheets/TemplateToolERP5LoginUserManagerConstraint.xml
...rty_sheets/TemplateToolERP5LoginUserManagerConstraint.xml
+66
-0
bt5/erp5_base/PropertySheetTemplateItem/portal_property_sheets/TemplateToolERP5LoginUserManagerConstraint/ERP5LoginUserNamager%20Existence_constraint.xml
...onstraint/ERP5LoginUserNamager%20Existence_constraint.xml
+80
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/TemplateTool_checkERP5LoginUserManagerExistenceConsistency.py
...lateTool_checkERP5LoginUserManagerExistenceConsistency.py
+12
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/TemplateTool_checkERP5LoginUserManagerExistenceConsistency.xml
...ateTool_checkERP5LoginUserManagerExistenceConsistency.xml
+62
-0
bt5/erp5_base/bt/template_path_list
bt5/erp5_base/bt/template_path_list
+1
-1
bt5/erp5_base/bt/template_portal_type_property_sheet_list
bt5/erp5_base/bt/template_portal_type_property_sheet_list
+2
-1
bt5/erp5_base/bt/template_property_sheet_id_list
bt5/erp5_base/bt/template_property_sheet_id_list
+2
-1
product/ERP5Security/tests/testERP5Security.py
product/ERP5Security/tests/testERP5Security.py
+13
-0
No files found.
bt5/erp5_base/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
0f043a4a
...
@@ -19,4 +19,7 @@
...
@@ -19,4 +19,7 @@
<portal_type
id=
"Query"
>
<portal_type
id=
"Query"
>
<item>
TextDocument
</item>
<item>
TextDocument
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Template Tool"
>
<item>
TemplateToolERP5LoginUserManagerConstraint
</item>
</portal_type>
</property_sheet_list>
</property_sheet_list>
\ No newline at end of file
bt5/erp5_base/PropertySheetTemplateItem/portal_property_sheets/TemplateToolERP5LoginUserManagerConstraint.xml
0 → 100644
View file @
0f043a4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TemplateToolERP5LoginUserManagerConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
bt5/erp5_base/PropertySheetTemplateItem/portal_property_sheets/TemplateToolERP5LoginUserManagerConstraint/ERP5LoginUserNamager%20Existence_constraint.xml
0 → 100644
View file @
0f043a4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Script Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
constraint_type/post_upgrade
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5LoginUserNamager Existence_constraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Script Constraint
</string>
</value>
</item>
<item>
<key>
<string>
script_id
</string>
</key>
<value>
<string>
TemplateTool_checkERP5LoginUserManagerExistenceConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/TemplateTool_checkERP5LoginUserManagerExistenceConsistency.py
0 → 100644
View file @
0f043a4a
acl_users
=
context
.
getPortalObject
().
acl_users
plugin_id
=
'erp5_login_users'
error_list
=
[]
if
plugin_id
not
in
acl_users
.
objectIds
():
error_list
.
append
(
'ERP5 Login User Manager does not exist as %s/%s'
%
(
acl_users
.
getPath
(),
plugin_id
))
if
fixit
:
acl_users
.
manage_addProduct
[
'ERP5Security'
].
addERP5LoginUserManager
(
plugin_id
)
getattr
(
acl_users
,
plugin_id
).
manage_activateInterfaces
([
'IAuthenticationPlugin'
,
'IUserEnumerationPlugin'
,
])
return
error_list
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/TemplateTool_checkERP5LoginUserManagerExistenceConsistency.xml
0 → 100644
View file @
0f043a4a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
fixit=False
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TemplateTool_checkERP5LoginUserManagerExistenceConsistency
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_base/bt/template_path_list
View file @
0f043a4a
portal_alarms/upgrader_migrate_to_embedded_file
portal_alarms/check_duplicate_login_reference
portal_alarms/check_duplicate_login_reference
portal_alarms/upgrader_migrate_to_embedded_file
portal_caches/document_cache_factory
portal_caches/document_cache_factory
portal_caches/document_cache_factory/**
portal_caches/document_cache_factory/**
portal_categories/collect_order_group/cell
portal_categories/collect_order_group/cell
...
...
bt5/erp5_base/bt/template_portal_type_property_sheet_list
View file @
0f043a4a
...
@@ -5,4 +5,5 @@ Person | DefaultImage
...
@@ -5,4 +5,5 @@ Person | DefaultImage
Person | PersonUpgradeConstraint
Person | PersonUpgradeConstraint
Preference | TelephonePreference
Preference | TelephonePreference
Previous Causality Movement Group | PreviousCausalityMovementGroup
Previous Causality Movement Group | PreviousCausalityMovementGroup
Query | TextDocument
Query | TextDocument
\ No newline at end of file
Template Tool | TemplateToolERP5LoginUserManagerConstraint
\ No newline at end of file
bt5/erp5_base/bt/template_property_sheet_id_list
View file @
0f043a4a
LoginConstraint
LoginConstraint
PersonUpgradeConstraint
PersonUpgradeConstraint
PreviousCausalityMovementGroup
PreviousCausalityMovementGroup
\ No newline at end of file
TemplateToolERP5LoginUserManagerConstraint
\ No newline at end of file
product/ERP5Security/tests/testERP5Security.py
View file @
0f043a4a
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
"""Tests ERP5 User Management.
"""Tests ERP5 User Management.
"""
"""
import
transaction
import
unittest
import
unittest
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
...
@@ -53,6 +54,7 @@ class TestUserManagement(ERP5TypeTestCase):
...
@@ -53,6 +54,7 @@ class TestUserManagement(ERP5TypeTestCase):
def
beforeTearDown
(
self
):
def
beforeTearDown
(
self
):
"""Clears person module and invalidate caches when tests are finished."""
"""Clears person module and invalidate caches when tests are finished."""
transaction
.
abort
()
self
.
getPersonModule
().
manage_delObjects
([
x
for
x
in
self
.
getPersonModule
().
manage_delObjects
([
x
for
x
in
self
.
getPersonModule
().
objectIds
()])
self
.
getPersonModule
().
objectIds
()])
self
.
tic
()
self
.
tic
()
...
@@ -392,6 +394,17 @@ class TestUserManagement(ERP5TypeTestCase):
...
@@ -392,6 +394,17 @@ class TestUserManagement(ERP5TypeTestCase):
self
.
_assertUserDoesNotExists
(
'the_user'
,
'secret'
)
self
.
_assertUserDoesNotExists
(
'the_user'
,
'secret'
)
self
.
_assertUserExists
(
'the_user'
,
'secret2'
)
self
.
_assertUserExists
(
'the_user'
,
'secret2'
)
def
test_ERP5LoginUserManagerMigration
(
self
):
acl_users
=
self
.
portal
.
acl_users
acl_users
.
manage_delObjects
(
ids
=
[
'erp5_login_users'
])
portal_templates
=
self
.
portal
.
portal_templates
self
.
assertNotEqual
(
portal_templates
.
checkConsistency
(
filter
=
{
'constraint_type'
:
'post_upgrade'
})
,
[])
# call checkConsistency again to check if FIX does not happen by checkConsistency().
self
.
assertNotEqual
(
portal_templates
.
checkConsistency
(
filter
=
{
'constraint_type'
:
'post_upgrade'
})
,
[])
portal_templates
.
fixConsistency
(
filter
=
{
'constraint_type'
:
'post_upgrade'
})
self
.
assertEqual
(
portal_templates
.
checkConsistency
(
filter
=
{
'constraint_type'
:
'post_upgrade'
})
,
[])
self
.
assertTrue
(
'erp5_login_users'
in
acl_users
)
def
test_AssignmentWithDate
(
self
):
def
test_AssignmentWithDate
(
self
):
"""Tests a person with an assignment with correct date is a valid user."""
"""Tests a person with an assignment with correct date is a valid user."""
date
=
DateTime
()
date
=
DateTime
()
...
...
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