Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

ACL functions

Help
2012-01-12
2013-04-25
  • 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.

     
  • Eric Brehault
    Eric Brehault
    2012-01-16

    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