fix external user API (syncExtUsers)
This commit is contained in:
parent
a7ba164768
commit
2a829d4dfb
1 changed files with 8 additions and 5 deletions
|
@ -176,10 +176,13 @@ def createExtUser(person, principal=None, updateIfExists=False):
|
|||
#print('*** Person.createExtUser', principal.login, res)
|
||||
|
||||
|
||||
def syncExtUsers(context, pfolderName):
|
||||
pf = getPrincipalFolder(context, pFolderName)
|
||||
def syncExtUsers(context, pfolderName, userIds=None, check=None):
|
||||
pf = getPrincipalFolder(context, pfolderName)
|
||||
for id, prc in pf.items():
|
||||
if userIds and id not in userIds:
|
||||
continue
|
||||
userId = pf.prefix + id
|
||||
person = getPersonForUser(
|
||||
context, principal=getPrincipalForUserId(userId, context))
|
||||
createExtUser(person, principal, True)
|
||||
person = adapted(getPersonForUser(
|
||||
context, principal=getPrincipalForUserId(userId, context)))
|
||||
if check is None or check(person):
|
||||
createExtUser(person, prc, True)
|
||||
|
|
Loading…
Add table
Reference in a new issue