Source

iredadmin-ose / libs / mysql / decorators.py

Diff from to

File libs/mysql/decorators.py

         if session.get('domainGlobalAdmin') is True:
             return func(*args, **kw)
         else:
-            if 'domain' in kw.keys() and iredutils.isDomain(kw.get('domain')):
+            if 'domain' in kw.keys() and iredutils.is_domain(kw.get('domain')):
                 domain = web.safestr(kw['domain'])
-            elif 'mail' in kw.keys() and iredutils.isEmail(kw.get('mail')):
+            elif 'mail' in kw.keys() and iredutils.is_email(kw.get('mail')):
                 domain = web.safestr(kw['mail']).split('@')[-1]
-            elif 'admin' in kw.keys() and iredutils.isEmail(kw.get('admin')):
+            elif 'admin' in kw.keys() and iredutils.is_email(kw.get('admin')):
                 domain = web.safestr(kw['admin']).split('@')[-1]
             else:
                 return (False, 'PERMISSION_DENIED')
 
             # Check whether is domain admin.
             validator = core.MySQLWrap()
-            if validator.isDomainAdmin(domain=domain, admin=session.get('username'),):
+            if validator.is_domainAdmin(domain=domain, admin=session.get('username'),):
                 return func(*args, **kw)
             else:
                 return (False, 'PERMISSION_DENIED')