Commit 551c7cae authored by Rafael Monnerat's avatar Rafael Monnerat

erp5_oauth_google_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 8022d3b3
...@@ -49,5 +49,12 @@ def getAccessTokenFromCode(self, code, redirect_uri): ...@@ -49,5 +49,12 @@ def getAccessTokenFromCode(self, code, redirect_uri):
credential_data = json.loads(credential.to_json()) credential_data = json.loads(credential.to_json())
return credential_data return credential_data
def unrestrictedSearchGoogleConnector(self):
return self.getPortalObject().portal_catalog.unrestrictedSearchResults(
portal_type="Google Connector",
reference="default",
validation_state="validated",
limit=2)
def getUserEntry(access_token): def getUserEntry(access_token):
return getGoogleUserEntry(access_token) return getGoogleUserEntry(access_token)
\ No newline at end of file
<?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>unrestrictedSearchGoogleConnector</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>GoogleLoginUtility</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getGoogleConnector</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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