Commit 8041c090 authored by Vincent Pelletier's avatar Vincent Pelletier

Products.ERP5Security: Declare module security locally

For simplicity and readability.
parent e0b68bdb
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
from six import string_types as basestring from six import string_types as basestring
from Products.ERP5Type.Globals import InitializeClass from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from AccessControl.SecurityInfo import ModuleSecurityInfo
from AccessControl.AuthEncoding import pw_validate from AccessControl.AuthEncoding import pw_validate
from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Products.PluggableAuthService.PluggableAuthService import \ from Products.PluggableAuthService.PluggableAuthService import \
...@@ -57,6 +58,7 @@ class _AuthenticationFailure(Exception): ...@@ -57,6 +58,7 @@ class _AuthenticationFailure(Exception):
etc...) etc...)
""" """
ModuleSecurityInfo(__name__).declarePublic('getUserByLogin')
@transactional_cached(lambda portal, *args: args) @transactional_cached(lambda portal, *args: args)
def getUserByLogin(portal, login, exact_match=True): def getUserByLogin(portal, login, exact_match=True):
if isinstance(login, basestring): if isinstance(login, basestring):
......
...@@ -238,7 +238,3 @@ def initialize(context): ...@@ -238,7 +238,3 @@ def initialize(context):
, visibility=None , visibility=None
, icon='www/portal.gif' , icon='www/portal.gif'
) )
from AccessControl.SecurityInfo import ModuleSecurityInfo
ModuleSecurityInfo('Products.ERP5Security.ERP5UserManager').declarePublic(
'getUserByLogin')
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