[MERGE] Forward-port saas-3 up to rev. 10e6ad1355
This commit is contained in:
commit
c345d294b1
|
@ -32,6 +32,7 @@ from openerp import SUPERUSER_ID, models
|
|||
from openerp import tools
|
||||
import openerp.exceptions
|
||||
from openerp.osv import fields, osv, expression
|
||||
from openerp.service.security import check_super
|
||||
from openerp.tools.translate import _
|
||||
from openerp.http import request
|
||||
|
||||
|
@ -426,10 +427,7 @@ class res_users(osv.osv):
|
|||
return dataobj.browse(cr, uid, data_id, context=context).res_id
|
||||
|
||||
def check_super(self, passwd):
|
||||
if passwd == tools.config['admin_passwd']:
|
||||
return True
|
||||
else:
|
||||
raise openerp.exceptions.AccessDenied()
|
||||
return check_super(passwd)
|
||||
|
||||
def check_credentials(self, cr, uid, password):
|
||||
""" Override this method to plug additional authentication methods"""
|
||||
|
|
|
@ -27,10 +27,9 @@ def login(db, login, password):
|
|||
return res_users._login(db, login, password)
|
||||
|
||||
def check_super(passwd):
|
||||
if passwd == openerp.tools.config['admin_passwd']:
|
||||
if passwd and passwd == openerp.tools.config['admin_passwd']:
|
||||
return True
|
||||
else:
|
||||
raise openerp.exceptions.AccessDenied()
|
||||
raise openerp.exceptions.AccessDenied()
|
||||
|
||||
def check(db, uid, passwd):
|
||||
res_users = openerp.registry(db)['res.users']
|
||||
|
|
Loading…
Reference in New Issue