Commit 8022d3b3 authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_oauth_facebook_login: Use unrestrictedSearchResults to avoid security_uid (Speed up)

When a script with manager proxy role is called from anonymous context, it include a HUGE list of security_uids, use unrestrictedSearchResults skips the unecessary usage of security_uids on catalog.
parent 24004c49
......@@ -37,5 +37,12 @@ def getAccessTokenFromCode(self, code, redirect_uri):
code=code, redirect_uri=redirect_uri,
app_id=client_id, app_secret=secret_key)
def unrestrictedSearchFacebookConnector(self):
return self.getPortalObject().portal_catalog.unrestrictedSearchResults(
portal_type="Facebook Connector",
reference="default",
validation_state="validated",
limit=2)
def getUserEntry(token):
return getFacebookUserEntry(token)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>unrestrictedSearchFacebookConnector</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>FacebookLoginUtility</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getFacebookConnector</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -115,7 +115,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Faceook Connector</string> </value>
<value> <string>Facebook Connector</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment