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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
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,
portal_path
=
context
.
getPortalObject
().
getPhysicalPath
(),
mirror
=
mirror
,
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
)
# 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():
knowledge_pad
.
visible
()
current_user
=
context
.
portal_membership
.
getAuthenticatedMember
()
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_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):
'''
# save previous user
previous_user
=
str
(
getSecurityManager
().
getUser
()
)
previous_user
=
getSecurityManager
().
getUser
().
getIdOrUseName
(
)
self
.
loginAsUser
(
login
)
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()
if
owner
is
not
None
:
current_user
=
context
.
portal_membership
.
getAuthenticatedMember
()
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
()
# set default gadgets
...
...
product/CMFActivity/ActivityTool.py
View file @
fe773036
...
...
@@ -182,7 +182,7 @@ class Message(BaseMessage):
# was generated.
# Strip last stack entry, since it will always be the same.
self
.
call_traceback
=
''
.
join
(
format_list
(
extract_stack
()[:
-
1
]))
self
.
user_name
=
str
(
_getAuthenticatedUser
(
self
)
)
self
.
user_name
=
_getAuthenticatedUser
(
self
).
getIdOrUserName
(
)
# Store REQUEST Info
self
.
request_info
=
{}
if
request
is
not
None
:
...
...
product/ERP5/Tool/ContributionTool.py
View file @
fe773036
...
...
@@ -480,7 +480,7 @@ class ContributionTool(BaseTool):
sm
=
getSecurityManager
()
user
=
sm
.
getUser
()
object_list
=
self
.
portal_catalog
(
portal_type
=
self
.
getPortalMyDocumentTypeList
(),
owner
=
str
(
user
))
owner
=
user
.
getIdOrUserName
(
))
def
wrapper
(
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):
getPreferredSectionItemList
=
CachingMethod
(
getPreferredSectionItemList
,
'%s.%s'
%
(
script
.
getId
(),
getSecurityManager
().
getUser
()),
getSecurityManager
().
getUser
()
.
getIdOrUserName
()
),
cache_factory
=
'erp5_ui_short'
)
section_item_list
=
getPreferredSectionItemList
(
portal_type
,
validation_state
)
...
...
product/ERP5/mixin/discoverable.py
View file @
fe773036
...
...
@@ -66,7 +66,7 @@ class DiscoverableMixin(CachedConvertableMixin):
returns properties which should be set on the document
"""
if
user_login
is
None
:
user_login
=
str
(
getSecurityManager
().
getUser
()
)
user_login
=
getSecurityManager
().
getUser
().
getIdOrUserName
(
)
method
=
self
.
_getTypeBasedMethod
(
'getPropertyDictFromUserLogin'
,
fallback_script_id
=
'Document_getPropertyDictFromUserLogin'
)
if
method
is
not
None
:
...
...
product/ERP5/tests/testERP5Credential.py
View file @
fe773036
...
...
@@ -410,7 +410,7 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
_assertUserExists
(
'homie'
,
'secret'
)
self
.
login
(
'homie'
)
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
):
'''
...
...
@@ -597,7 +597,7 @@ class TestERP5Credential(ERP5TypeTestCase):
self
.
_assertUserExists
(
'barney'
,
'secret'
)
self
.
login
(
'barney'
)
from
AccessControl
import
getSecurityManager
self
.
assertEqual
(
str
(
getSecurityManager
().
getUser
()
),
'barney'
)
self
.
assertEqual
(
getSecurityManager
().
getUser
().
getIdOrUserName
(
),
'barney'
)
self
.
login
()
# create a credential recovery
...
...
product/ERP5/tests/testERP5Web.py
View file @
fe773036
...
...
@@ -321,11 +321,11 @@ Hé Hé Hé!""", page.asText().strip())
# check if user account is 'loggable'
uf
=
portal
.
acl_users
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
.
login
(
kw
[
'reference'
])
self
.
assertEqual
(
kw
[
'reference'
],
str
(
portal
.
portal_membership
.
getAuthenticatedMember
()
))
portal
.
portal_membership
.
getAuthenticatedMember
().
getIdOrUserName
(
))
# test redirection to person oobject
path
=
website
.
absolute_url_path
()
+
'/WebSite_redirectToUserView'
...
...
product/ERP5Catalog/CatalogTool.py
View file @
fe773036
...
...
@@ -473,7 +473,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
getSecurityQuery instead
"""
user
=
_getAuthenticatedUser
(
self
)
user_str
=
str
(
user
)
user_str
=
user
.
getIdOrUserName
(
)
user_is_superuser
=
(
user
==
system_user
)
or
(
user_str
==
ERP5Security
.
SUPER_USER
)
allowedRolesAndUsers
=
self
.
_listAllowedRolesAndUsers
(
user
)
role_column_dict
=
{}
...
...
@@ -599,7 +599,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
catalogued with columns.
"""
user
=
_getAuthenticatedUser
(
self
)
user_str
=
str
(
user
)
user_str
=
user
.
getIdOrUserName
(
)
user_is_superuser
=
(
user
==
system_user
)
or
(
user_str
==
ERP5Security
.
SUPER_USER
)
if
user_is_superuser
:
# We need no security check for super user.
...
...
product/ERP5Form/PreferenceTool.py
View file @
fe773036
...
...
@@ -149,10 +149,10 @@ class PreferenceTool(BaseTool):
# reset a security manager without any proxy role or unrestricted method,
# wich affects the catalog search that we do to find applicable
# preferences.
actual_user
=
acl_users
.
getUser
(
str
(
user
))
actual_user
=
acl_users
.
getUser
(
user
.
getIdOrUserName
(
))
if
actual_user
is
not
None
:
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
)
if
tv
.
get
(
tv_key
,
None
)
is
None
:
prefs
=
[]
...
...
@@ -284,7 +284,7 @@ class PreferenceTool(BaseTool):
return
False
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
:
_isAuthenticationPolicyEnabled
=
CachingMethod
(
_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):
key
=
lambda
x
:
'/'
.
join
((
x
[
'workflow_id'
],
x
[
'worklist_id'
])),
)
return
action_list
user
=
str
(
_getAuthenticatedUser
(
self
)
)
user
=
_getAuthenticatedUser
(
self
).
getIdOrUserName
(
)
if
src__
:
actions
=
_getWorklistActionList
()
else
:
...
...
product/MailTemplates/FSMailTemplate.py
View file @
fe773036
...
...
@@ -66,7 +66,7 @@ class FSMailTemplate(BaseMailTemplate,FSPageTemplate):
bound_names
[
'options'
]
=
kw
security
=
getSecurityManager
()
bound_names
[
'user'
]
=
security
.
getUser
()
bound_names
[
'user'
]
=
security
.
getUser
()
.
getIdOrUserName
()
# Retrieve the value from the cache.
keyset
=
None
...
...
product/MailTemplates/MailTemplate.py
View file @
fe773036
...
...
@@ -70,7 +70,7 @@ class MailTemplate(BaseMailTemplate,ZopePageTemplate):
bound_names
[
'options'
]
=
kw
security
=
getSecurityManager
()
bound_names
[
'user'
]
=
security
.
getUser
()
bound_names
[
'user'
]
=
security
.
getUser
()
.
getIdOrUserName
()
# Retrieve the value from the cache.
keyset
=
None
...
...
product/ZSQLCatalog/SQLCatalog.py
View file @
fe773036
...
...
@@ -2832,7 +2832,7 @@ class Catalog(Folder,
#'root': ob.getPhysicalRoot(),
#'request': getattr( ob, 'REQUEST', None ),
#'modules': SecureModuleImporter,
#'user': getSecurityManager().getUser(),
#'user': getSecurityManager().getUser()
.getIdOrUserName()
,
# XXX these below are defined, because there is no
# accessor for some attributes, and restricted environment
# 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