Hi guys, I tried using these functions, in the computed field, and they don't return anything:
return db.getUsersForRoles("Test1") return db.getUserRoles()
db has been defined previously, and Test1 is a role, in the ACL and contains 3 user names. How do you use these functions correctly?
Thank you Eliott
Forgot to add, I tried also "" and single quotes, with no result.
Hello,
db.getUsersForRoles('') is the correct way to do it.
It will return a list so maybe you should convert it into a string: return " ".join(db.getUsersForRoles(''))
if it does not work, add some trace like: context.plone_log(db.getUserRoles()) and see in the log if it does look right.
Eric
Log in to post a comment.
Hi guys, I tried using these functions, in the computed field, and they don't return anything:
return db.getUsersForRoles("Test1")
return db.getUserRoles()
db has been defined previously, and Test1 is a role, in the ACL and contains 3 user names.
How do you use these functions correctly?
Thank you
Eliott
Forgot to add, I tried also "" and single quotes, with no result.
Hello,
db.getUsersForRoles('') is the correct way to do it.
It will return a list so maybe you should convert it into a string:
return " ".join(db.getUsersForRoles(''))
if it does not work, add some trace like:
context.plone_log(db.getUserRoles())
and see in the log if it does look right.
Eric