How to get the name of the authenticated user when writing cmf types ?
Dear People, I am coding a cmftype to be used together with Plone. My question is why can i get the user using : self.REQUEST['AUTHENTICATED_USER'].getUserName() but when i try : AccessControl.SecurityManager.getUserName() it gives me an error saying that type 'module' is uncallable ? Any help or explanation is appreciated. Thank you. __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com
Low Kian Seong wrote:
Dear People,
I am coding a cmftype to be used together with Plone. My question is why can i get the user using :
self.REQUEST['AUTHENTICATED_USER'].getUserName()
but when i try :
AccessControl.SecurityManager.getUserName()
it gives me an error saying that type 'module' is uncallable ?
Any help or explanation is appreciated. Thank you.
You want to query a SecurityManager instance, not a reference to the module itself. from AccessControl import getSecurityManager securityManager = getSecurityManager() user = securityManager.getUser() userName = user.getUserName() -- Jim Washington
participants (2)
-
Jim Washington -
Low Kian Seong