You are here: Home Plone My Python Scripts Look up users role and if workflow state of document/object is published
Search
Advanced Search…
E-Mail

Webmail: webmail.wyden.com

E-Mail Preferences: postfix.wyden.com/users

E-Mail Administration: postfix.wyden.com

Statistics
Total: 463
Total Pages: 284
Total Folders: 87
Total Files: 18
Total Links: 26
Last modification: 03.02.2012 16:00
 

Look up users role and if workflow state of document/object is published

by Wyden Silvan last modified 30.10.2009 13:50

from AccessControl import getSecurityManager

mystate = context.portal_workflow.getInfoFor(context, 'review_state')
user = getSecurityManager().getUser();
userRoles = user.getRoles()

if mystate == 'published' and not 'Manager' in userRoles or context.absolute_url() == context.portal_url() + '/tabellenvorlage' :
    return False
else:
    return True