r252349 - in PASPlugins/SQLPASPlugin/trunk: . plugins

"David Glick" <svn-changes-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.collective.cvs
Message-ID <[email protected]>
Author: davisagli
Date: Mon Apr 29 21:20:32 2013
New Revision: 252349

Modified:
   PASPlugins/SQLPASPlugin/trunk/HISTORY.txt
   PASPlugins/SQLPASPlugin/trunk/plugins/rolemanager.py
Log:
handle __ignore_direct_roles__ properly

Modified: PASPlugins/SQLPASPlugin/trunk/HISTORY.txt
==============================================================================
--- PASPlugins/SQLPASPlugin/trunk/HISTORY.txt	(original)
+++ PASPlugins/SQLPASPlugin/trunk/HISTORY.txt	Mon Apr 29 21:20:32 2013
@@ -4,6 +4,11 @@
 
 SQLPASPlugin - unreleased
 
+    - Handle the __ignore_direct_roles__ flag passed by
+      plone.app.controlpanel when it's trying to retrieve roles
+      that come via group membership.
+      [davisagli]
+
     - Ignore the 'name' keyword when passed to enumerateUsers.
       It is passed by recent versions of Plone, but we can't
       query it efficiently.

Modified: PASPlugins/SQLPASPlugin/trunk/plugins/rolemanager.py
==============================================================================
--- PASPlugins/SQLPASPlugin/trunk/plugins/rolemanager.py	(original)
+++ PASPlugins/SQLPASPlugin/trunk/plugins/rolemanager.py	Mon Apr 29 21:20:32 2013
@@ -1,5 +1,6 @@
 from Globals import DTMLFile
 from AccessControl import ClassSecurityInfo
+from Acquisition import aq_get
 from App.class_init import default__class_init__ as InitializeClass
 
 from Products.PluggableAuthService.interfaces.plugins import IRolesPlugin
@@ -127,6 +128,11 @@
         o Return a sequence of role names which the principal has.
         o May assign roles based on values in the REQUEST object, if present.
         """
+        request = aq_get(self, 'REQUEST', None)
+        if request is not None and \
+            request.get('__ignore_direct_roles__', False):
+            return []
+
         view_name = createViewName('getRolesForPrincipal', principal)
         cached_info = self.ZCacheable_get(view_name)
         if cached_info is not None:

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.