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
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
Boxiang Sun
erp5
Commits
fe773036
Commit
fe773036
authored
Dec 09, 2016
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use getIdOrUserName() instead of __str__().
parent
e8ae14a5
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
21 additions
and
21 deletions
+21
-21
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getNodeItemList.py
...5_accounting/AccountingTransactionLine_getNodeItemList.py
+1
-1
bt5/erp5_configurator_run_my_doc/SkinTemplateItem/portal_skins/erp5_configurator_run_my_doc/BusinessConfiguration_afterRunMyDocConfiguration.py
...y_doc/BusinessConfiguration_afterRunMyDocConfiguration.py
+1
-1
bt5/erp5_egov/TestTemplateItem/portal_components/test.erp5.TestEGovMixin.py
...TemplateItem/portal_components/test.erp5.TestEGovMixin.py
+1
-1
bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_createDefaultKnowledgePadListForUser.py
...edge_pad/ERP5Site_createDefaultKnowledgePadListForUser.py
+1
-1
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+1
-1
product/ERP5/Tool/ContributionTool.py
product/ERP5/Tool/ContributionTool.py
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getPreferredSectionItemList.py
...ortal_skins/erp5_core/Base_getPreferredSectionItemList.py
+1
-1
product/ERP5/mixin/discoverable.py
product/ERP5/mixin/discoverable.py
+1
-1
product/ERP5/tests/testERP5Credential.py
product/ERP5/tests/testERP5Credential.py
+2
-2
product/ERP5/tests/testERP5Web.py
product/ERP5/tests/testERP5Web.py
+2
-2
product/ERP5Catalog/CatalogTool.py
product/ERP5Catalog/CatalogTool.py
+2
-2
product/ERP5Form/PreferenceTool.py
product/ERP5Form/PreferenceTool.py
+3
-3
product/ERP5Type/patches/WorkflowTool.py
product/ERP5Type/patches/WorkflowTool.py
+1
-1
product/MailTemplates/FSMailTemplate.py
product/MailTemplates/FSMailTemplate.py
+1
-1
product/MailTemplates/MailTemplate.py
product/MailTemplates/MailTemplate.py
+1
-1
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+1
-1
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionLine_getNodeItemList.py
View file @
fe773036
...
@@ -89,7 +89,7 @@ item_list = getItemList( category=category,
...
@@ -89,7 +89,7 @@ item_list = getItemList( category=category,
portal_path
=
context
.
getPortalObject
().
getPhysicalPath
(),
portal_path
=
context
.
getPortalObject
().
getPhysicalPath
(),
mirror
=
mirror
,
mirror
=
mirror
,
omit_filter
=
omit_filter
,
# XXX possible optim: only one cache if omit_filter
omit_filter
=
omit_filter
,
# XXX possible optim: only one cache if omit_filter
user_name
=
str
(
getSecurityManager
().
getUser
()
),
user_name
=
getSecurityManager
().
getUser
().
getIdOrUserName
(
),
simulation_state
=
simulation_state
)
simulation_state
=
simulation_state
)
# make sure that the current value is included in this list, this is
# make sure that the current value is included in this list, this is
...
...
bt5/erp5_configurator_run_my_doc/SkinTemplateItem/portal_skins/erp5_configurator_run_my_doc/BusinessConfiguration_afterRunMyDocConfiguration.py
View file @
fe773036
...
@@ -92,7 +92,7 @@ for person in context.person_module.objectValues():
...
@@ -92,7 +92,7 @@ for person in context.person_module.objectValues():
knowledge_pad
.
visible
()
knowledge_pad
.
visible
()
current_user
=
context
.
portal_membership
.
getAuthenticatedMember
()
current_user
=
context
.
portal_membership
.
getAuthenticatedMember
()
knowledge_pad
.
manage_setLocalRoles
(
userid
=
user_name
,
roles
=
[
'Owner'
])
knowledge_pad
.
manage_setLocalRoles
(
userid
=
user_name
,
roles
=
[
'Owner'
])
knowledge_pad
.
manage_delLocalRoles
([
str
(
current_user
)])
knowledge_pad
.
manage_delLocalRoles
([
current_user
.
getIdOrUserName
(
)])
knowledge_pad
.
reindexObject
()
knowledge_pad
.
reindexObject
()
knowledge_box
=
knowledge_pad
.
newContent
(
portal_type
=
'Knowledge Box'
,
knowledge_box
=
knowledge_pad
.
newContent
(
portal_type
=
'Knowledge Box'
,
...
...
bt5/erp5_egov/TestTemplateItem/portal_components/test.erp5.TestEGovMixin.py
View file @
fe773036
...
@@ -335,7 +335,7 @@ class TestEGovMixin(SecurityTestCase):
...
@@ -335,7 +335,7 @@ class TestEGovMixin(SecurityTestCase):
'''
'''
# save previous user
# save previous user
previous_user
=
str
(
getSecurityManager
().
getUser
()
)
previous_user
=
getSecurityManager
().
getUser
().
getIdOrUseName
(
)
self
.
loginAsUser
(
login
)
self
.
loginAsUser
(
login
)
worklist_dict
=
self
.
portal
.
getPortalTypeWorklistDictForWorkflow
(
\
worklist_dict
=
self
.
portal
.
getPortalTypeWorklistDictForWorkflow
(
\
...
...
bt5/erp5_knowledge_pad/SkinTemplateItem/portal_skins/erp5_knowledge_pad/ERP5Site_createDefaultKnowledgePadListForUser.py
View file @
fe773036
...
@@ -56,7 +56,7 @@ knowledge_pad.visible()
...
@@ -56,7 +56,7 @@ knowledge_pad.visible()
if
owner
is
not
None
:
if
owner
is
not
None
:
current_user
=
context
.
portal_membership
.
getAuthenticatedMember
()
current_user
=
context
.
portal_membership
.
getAuthenticatedMember
()
knowledge_pad
.
manage_setLocalRoles
(
userid
=
owner
,
roles
=
[
'Owner'
])
knowledge_pad
.
manage_setLocalRoles
(
userid
=
owner
,
roles
=
[
'Owner'
])
knowledge_pad
.
manage_delLocalRoles
([
str
(
current_user
)])
knowledge_pad
.
manage_delLocalRoles
([
current_user
.
getIdOrUserName
(
)])
knowledge_pad
.
reindexObject
()
knowledge_pad
.
reindexObject
()
# set default gadgets
# set default gadgets
...
...
product/CMFActivity/ActivityTool.py
View file @
fe773036
...
@@ -182,7 +182,7 @@ class Message(BaseMessage):
...
@@ -182,7 +182,7 @@ class Message(BaseMessage):
# was generated.
# was generated.
# Strip last stack entry, since it will always be the same.
# Strip last stack entry, since it will always be the same.
self
.
call_traceback
=
''
.
join
(
format_list
(
extract_stack
()[:
-
1
]))
self
.
call_traceback
=
''
.
join
(
format_list
(
extract_stack
()[:
-
1
]))
self
.
user_name
=
str
(
_getAuthenticatedUser
(
self
)
)
self
.
user_name
=
_getAuthenticatedUser
(
self
).
getIdOrUserName
(
)
# Store REQUEST Info
# Store REQUEST Info
self
.
request_info
=
{}
self
.
request_info
=
{}
if
request
is
not
None
:
if
request
is
not
None
:
...
...
product/ERP5/Tool/ContributionTool.py
View file @
fe773036
...
@@ -480,7 +480,7 @@ class ContributionTool(BaseTool):
...
@@ -480,7 +480,7 @@ class ContributionTool(BaseTool):
sm
=
getSecurityManager
()
sm
=
getSecurityManager
()
user
=
sm
.
getUser
()
user
=
sm
.
getUser
()
object_list
=
self
.
portal_catalog
(
portal_type
=
self
.
getPortalMyDocumentTypeList
(),
object_list
=
self
.
portal_catalog
(
portal_type
=
self
.
getPortalMyDocumentTypeList
(),
owner
=
str
(
user
))
owner
=
user
.
getIdOrUserName
(
))
def
wrapper
(
o_list
):
def
wrapper
(
o_list
):
for
o
in
o_list
:
for
o
in
o_list
:
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getPreferredSectionItemList.py
View file @
fe773036
...
@@ -26,7 +26,7 @@ def getPreferredSectionItemList(portal_type, validation_state):
...
@@ -26,7 +26,7 @@ def getPreferredSectionItemList(portal_type, validation_state):
getPreferredSectionItemList
=
CachingMethod
(
getPreferredSectionItemList
,
getPreferredSectionItemList
=
CachingMethod
(
getPreferredSectionItemList
,
'%s.%s'
%
(
script
.
getId
(),
'%s.%s'
%
(
script
.
getId
(),
getSecurityManager
().
getUser
()),
getSecurityManager
().
getUser
()
.
getIdOrUserName
()
),
cache_factory
=
'erp5_ui_short'
)
cache_factory
=
'erp5_ui_short'
)
section_item_list
=
getPreferredSectionItemList
(
portal_type
,
validation_state
)
section_item_list
=
getPreferredSectionItemList
(
portal_type
,
validation_state
)
...
...
product/ERP5/mixin/discoverable.py
View file @
fe773036
...
@@ -66,7 +66,7 @@ class DiscoverableMixin(CachedConvertableMixin):
...
@@ -66,7 +66,7 @@ class DiscoverableMixin(CachedConvertableMixin):
returns properties which should be set on the document
returns properties which should be set on the document
"""
"""
if
user_login
is
None
:
if
user_login
is
None
:
user_login
=
str
(
getSecurityManager
().
getUser
()
)
user_login
=
getSecurityManager
().
getUser
().
getIdOrUserName
(
)
method
=
self
.
_getTypeBasedMethod
(
'getPropertyDictFromUserLogin'
,
method
=
self
.
_getTypeBasedMethod
(
'getPropertyDictFromUserLogin'
,
fallback_script_id
=
'Document_getPropertyDictFromUserLogin'
)
fallback_script_id
=
'Document_getPropertyDictFromUserLogin'
)
if
method
is
not
None
:
if
method
is
not
None
:
...
...
product/ERP5/tests/testERP5Credential.py
View file @
fe773036
...
@@ -410,7 +410,7 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -410,7 +410,7 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
_assertUserExists
(
'homie'
,
'secret'
)
self
.
_assertUserExists
(
'homie'
,
'secret'
)
self
.
login
(
'homie'
)
self
.
login
(
'homie'
)
from
AccessControl
import
getSecurityManager
from
AccessControl
import
getSecurityManager
self
.
assertEqual
(
str
(
getSecurityManager
().
getUser
()
),
'homie'
)
self
.
assertEqual
(
getSecurityManager
().
getUser
().
getIdOrUserName
(
),
'homie'
)
def
stepCreateCredentialUpdate
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
def
stepCreateCredentialUpdate
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
'''
'''
...
@@ -597,7 +597,7 @@ class TestERP5Credential(ERP5TypeTestCase):
...
@@ -597,7 +597,7 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
_assertUserExists
(
'barney'
,
'secret'
)
self
.
_assertUserExists
(
'barney'
,
'secret'
)
self
.
login
(
'barney'
)
self
.
login
(
'barney'
)
from
AccessControl
import
getSecurityManager
from
AccessControl
import
getSecurityManager
self
.
assertEqual
(
str
(
getSecurityManager
().
getUser
()
),
'barney'
)
self
.
assertEqual
(
getSecurityManager
().
getUser
().
getIdOrUserName
(
),
'barney'
)
self
.
login
()
self
.
login
()
# create a credential recovery
# create a credential recovery
...
...
product/ERP5/tests/testERP5Web.py
View file @
fe773036
...
@@ -321,11 +321,11 @@ Hé Hé Hé!""", page.asText().strip())
...
@@ -321,11 +321,11 @@ Hé Hé Hé!""", page.asText().strip())
# check if user account is 'loggable'
# check if user account is 'loggable'
uf
=
portal
.
acl_users
uf
=
portal
.
acl_users
user
=
uf
.
getUserById
(
kw
[
'reference'
])
user
=
uf
.
getUserById
(
kw
[
'reference'
])
self
.
assertEqual
(
str
(
user
),
kw
[
'reference'
])
self
.
assertEqual
(
user
.
getIdOrUserName
(
),
kw
[
'reference'
])
self
.
assertEqual
(
1
,
user
.
has_role
((
'Member'
,
'Authenticated'
,)))
self
.
assertEqual
(
1
,
user
.
has_role
((
'Member'
,
'Authenticated'
,)))
self
.
login
(
kw
[
'reference'
])
self
.
login
(
kw
[
'reference'
])
self
.
assertEqual
(
kw
[
'reference'
],
self
.
assertEqual
(
kw
[
'reference'
],
str
(
portal
.
portal_membership
.
getAuthenticatedMember
()
))
portal
.
portal_membership
.
getAuthenticatedMember
().
getIdOrUserName
(
))
# test redirection to person oobject
# test redirection to person oobject
path
=
website
.
absolute_url_path
()
+
'/WebSite_redirectToUserView'
path
=
website
.
absolute_url_path
()
+
'/WebSite_redirectToUserView'
...
...
product/ERP5Catalog/CatalogTool.py
View file @
fe773036
...
@@ -473,7 +473,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -473,7 +473,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
getSecurityQuery instead
getSecurityQuery instead
"""
"""
user
=
_getAuthenticatedUser
(
self
)
user
=
_getAuthenticatedUser
(
self
)
user_str
=
str
(
user
)
user_str
=
user
.
getIdOrUserName
(
)
user_is_superuser
=
(
user
==
system_user
)
or
(
user_str
==
ERP5Security
.
SUPER_USER
)
user_is_superuser
=
(
user
==
system_user
)
or
(
user_str
==
ERP5Security
.
SUPER_USER
)
allowedRolesAndUsers
=
self
.
_listAllowedRolesAndUsers
(
user
)
allowedRolesAndUsers
=
self
.
_listAllowedRolesAndUsers
(
user
)
role_column_dict
=
{}
role_column_dict
=
{}
...
@@ -599,7 +599,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
...
@@ -599,7 +599,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
catalogued with columns.
catalogued with columns.
"""
"""
user
=
_getAuthenticatedUser
(
self
)
user
=
_getAuthenticatedUser
(
self
)
user_str
=
str
(
user
)
user_str
=
user
.
getIdOrUserName
(
)
user_is_superuser
=
(
user
==
system_user
)
or
(
user_str
==
ERP5Security
.
SUPER_USER
)
user_is_superuser
=
(
user
==
system_user
)
or
(
user_str
==
ERP5Security
.
SUPER_USER
)
if
user_is_superuser
:
if
user_is_superuser
:
# We need no security check for super user.
# We need no security check for super user.
...
...
product/ERP5Form/PreferenceTool.py
View file @
fe773036
...
@@ -149,10 +149,10 @@ class PreferenceTool(BaseTool):
...
@@ -149,10 +149,10 @@ class PreferenceTool(BaseTool):
# reset a security manager without any proxy role or unrestricted method,
# reset a security manager without any proxy role or unrestricted method,
# wich affects the catalog search that we do to find applicable
# wich affects the catalog search that we do to find applicable
# preferences.
# preferences.
actual_user
=
acl_users
.
getUser
(
str
(
user
))
actual_user
=
acl_users
.
getUser
(
user
.
getIdOrUserName
(
))
if
actual_user
is
not
None
:
if
actual_user
is
not
None
:
newSecurityManager
(
None
,
actual_user
.
__of__
(
acl_users
))
newSecurityManager
(
None
,
actual_user
.
__of__
(
acl_users
))
tv_key
=
'PreferenceTool._getSortedPreferenceList/%s/%s'
%
(
user
,
tv_key
=
'PreferenceTool._getSortedPreferenceList/%s/%s'
%
(
user
.
getIdOrUserName
()
,
sql_catalog_id
)
sql_catalog_id
)
if
tv
.
get
(
tv_key
,
None
)
is
None
:
if
tv
.
get
(
tv_key
,
None
)
is
None
:
prefs
=
[]
prefs
=
[]
...
@@ -284,7 +284,7 @@ class PreferenceTool(BaseTool):
...
@@ -284,7 +284,7 @@ class PreferenceTool(BaseTool):
return
False
return
False
tv
=
getTransactionalVariable
()
tv
=
getTransactionalVariable
()
tv_key
=
'PreferenceTool._isAuthenticationPolicyEnabled.%s'
%
getSecurityManager
().
getUser
()
tv_key
=
'PreferenceTool._isAuthenticationPolicyEnabled.%s'
%
getSecurityManager
().
getUser
()
.
getIdOrUserName
()
if
tv
.
get
(
tv_key
,
None
)
is
None
:
if
tv
.
get
(
tv_key
,
None
)
is
None
:
_isAuthenticationPolicyEnabled
=
CachingMethod
(
_isAuthenticationPolicyEnabled
,
_isAuthenticationPolicyEnabled
=
CachingMethod
(
_isAuthenticationPolicyEnabled
,
id
=
'PortalPreferences_isAuthenticationPolicyEnabled'
,
id
=
'PortalPreferences_isAuthenticationPolicyEnabled'
,
...
...
product/ERP5Type/patches/WorkflowTool.py
View file @
fe773036
...
@@ -597,7 +597,7 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False):
...
@@ -597,7 +597,7 @@ def WorkflowTool_listActions(self, info=None, object=None, src__=False):
key
=
lambda
x
:
'/'
.
join
((
x
[
'workflow_id'
],
x
[
'worklist_id'
])),
key
=
lambda
x
:
'/'
.
join
((
x
[
'workflow_id'
],
x
[
'worklist_id'
])),
)
)
return
action_list
return
action_list
user
=
str
(
_getAuthenticatedUser
(
self
)
)
user
=
_getAuthenticatedUser
(
self
).
getIdOrUserName
(
)
if
src__
:
if
src__
:
actions
=
_getWorklistActionList
()
actions
=
_getWorklistActionList
()
else
:
else
:
...
...
product/MailTemplates/FSMailTemplate.py
View file @
fe773036
...
@@ -66,7 +66,7 @@ class FSMailTemplate(BaseMailTemplate,FSPageTemplate):
...
@@ -66,7 +66,7 @@ class FSMailTemplate(BaseMailTemplate,FSPageTemplate):
bound_names
[
'options'
]
=
kw
bound_names
[
'options'
]
=
kw
security
=
getSecurityManager
()
security
=
getSecurityManager
()
bound_names
[
'user'
]
=
security
.
getUser
()
bound_names
[
'user'
]
=
security
.
getUser
()
.
getIdOrUserName
()
# Retrieve the value from the cache.
# Retrieve the value from the cache.
keyset
=
None
keyset
=
None
...
...
product/MailTemplates/MailTemplate.py
View file @
fe773036
...
@@ -70,7 +70,7 @@ class MailTemplate(BaseMailTemplate,ZopePageTemplate):
...
@@ -70,7 +70,7 @@ class MailTemplate(BaseMailTemplate,ZopePageTemplate):
bound_names
[
'options'
]
=
kw
bound_names
[
'options'
]
=
kw
security
=
getSecurityManager
()
security
=
getSecurityManager
()
bound_names
[
'user'
]
=
security
.
getUser
()
bound_names
[
'user'
]
=
security
.
getUser
()
.
getIdOrUserName
()
# Retrieve the value from the cache.
# Retrieve the value from the cache.
keyset
=
None
keyset
=
None
...
...
product/ZSQLCatalog/SQLCatalog.py
View file @
fe773036
...
@@ -2832,7 +2832,7 @@ class Catalog(Folder,
...
@@ -2832,7 +2832,7 @@ class Catalog(Folder,
#'root': ob.getPhysicalRoot(),
#'root': ob.getPhysicalRoot(),
#'request': getattr( ob, 'REQUEST', None ),
#'request': getattr( ob, 'REQUEST', None ),
#'modules': SecureModuleImporter,
#'modules': SecureModuleImporter,
#'user': getSecurityManager().getUser(),
#'user': getSecurityManager().getUser()
.getIdOrUserName()
,
# XXX these below are defined, because there is no
# XXX these below are defined, because there is no
# accessor for some attributes, and restricted environment
# accessor for some attributes, and restricted environment
# may not access them directly.
# may not access them directly.
...
...
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