{"id":9,"date":"2007-06-24T11:09:36","date_gmt":"2007-06-24T18:09:36","guid":{"rendered":"http:\/\/www.reisun.com\/2007\/06\/24\/plone-pas-not-hooked-up-to-portal_membership\/"},"modified":"2007-06-24T11:09:36","modified_gmt":"2007-06-24T18:09:36","slug":"plone-pas-not-hooked-up-to-portal_membership","status":"publish","type":"post","link":"https:\/\/www.reisun.com\/?p=9","title":{"rendered":"Plone PAS NOT hooked up to portal_membership?"},"content":{"rendered":"<p>I have been trying to convert my course website code to work with the new Plone 2.5.2 install. Typically, new features aren&#8217;t documented clearly or at all. The biggest hangup is the PlonePAS setup, that has changed the way membership data is accessed. No longer do portal_membership calls work, or at least not completely.\u00c2\u00a0 For example, <code>context.portal_membership.listMemberIds()<\/code> works, but only for the users defined in the default member plugin. I use SQLPASPlugin, and the above code does not list members defined in an SQL database.<\/p>\n<p>The only way I&#8217;ve been able to get access to them programmatically is to use <code>context.acl_users.X<\/code> which I am not sure is the right way. Some test code below:<br \/>\n<code><br \/>\n# Test code for new PAS Plugin architecture---NOT hooked into portal_membership<br \/>\n# print \"Current User: \",context.portal_membership.getAuthenticatedMember()<br \/>\n# print \"Users: \",context.portal_membership.listMemberIds()<br \/>\n# print \"Search Users: \",context.portal_membership.searchForMembers(name='staff1')[0].getRoles()<br \/>\n# print \"Search Roles: \",context.portal_membership.searchForMembers(roles='cscishstaff')<br \/>\n# print \"acl_users: \"<br \/>\n# users=context.acl_users.searchUsers(roles='staff')<br \/>\n# for u in users:<br \/>\n#\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 print \"%s(%s)\"%(u['userid'],u['title'])<br \/>\n#\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 print u<br \/>\n# return printed<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been trying to convert my course website code to work with the new Plone 2.5.2 install. Typically, new features aren&#8217;t documented clearly or at all. The biggest hangup is the PlonePAS setup, that has changed the way membership data is accessed. No longer do portal_membership calls work, or at least not completely.\u00c2\u00a0 For [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-web","category-webcourse"],"_links":{"self":[{"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reisun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9"}],"version-history":[{"count":0,"href":"https:\/\/www.reisun.com\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.reisun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reisun.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reisun.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}