Menu

ACL functions

Help
2012-01-12
2013-04-25
  • Eliott Minkovitch

    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

     
  • Eliott Minkovitch

    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

     

Log in to post a comment.