- Timestamp:
- 10 Dec 2014, 11:12:42 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/authentication.py
r11949 r12189 40 40 IBatchProcessor, IGNORE_MARKER, IFailedLoginInfo) 41 41 from waeup.ikoba.utils.batching import BatchProcessor 42 from waeup.ikoba.permissions import get_all_roles 42 43 43 44 def setup_authentication(pau): … … 513 514 return 514 515 516 def checkConversion(self, row, mode='ignore'): 517 """Validates all values in row. 518 """ 519 errs, inv_errs, conv_dict = super( 520 UserProcessor, self).checkConversion(row, mode=mode) 521 # We need to check if roles exist. 522 roles = row.get('roles', None) 523 all_roles = [i[0] for i in get_all_roles()] 524 if roles not in ('', IGNORE_MARKER): 525 evalvalue = eval(roles) 526 for role in evalvalue: 527 if role not in all_roles: 528 errs.append(('roles','invalid role')) 529 return errs, inv_errs, conv_dict 530 515 531 class UsersPlugin(grok.GlobalUtility): 516 532 """A plugin that updates users.
Note: See TracChangeset for help on using the changeset viewer.