manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1817018 - in /manifoldcf/trunk: CHANGES.txt connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/alfrescowebscript/AlfrescoAuthorityConnector.java
Date Sun, 03 Dec 2017 09:19:46 GMT
Author: kwright
Date: Sun Dec  3 09:19:46 2017
New Revision: 1817018

URL: http://svn.apache.org/viewvc?rev=1817018&view=rev
Log:
CONNECTORS-1473: Tentative fix for alfresco authority user token return.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/alfrescowebscript/AlfrescoAuthorityConnector.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1817018&r1=1817017&r2=1817018&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Sun Dec  3 09:19:46 2017
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 2.9-dev =====================
 
+CONNECTORS-1473: Alfresco authority did not return user token, just
+groups.
+(Phillip Rhodes, Karl Wright)
+
 CONNECTORS-1471: File system output connector's delete method
 was completely broken.
 (David Hotchkiss)

Modified: manifoldcf/trunk/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/alfrescowebscript/AlfrescoAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/alfrescowebscript/AlfrescoAuthorityConnector.java?rev=1817018&r1=1817017&r2=1817018&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/alfrescowebscript/AlfrescoAuthorityConnector.java
(original)
+++ manifoldcf/trunk/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/alfrescowebscript/AlfrescoAuthorityConnector.java
Sun Dec  3 09:19:46 2017
@@ -27,6 +27,7 @@ import org.apache.manifoldcf.core.interf
 
 import java.io.IOException;
 import java.util.List;
+import java.util.ArrayList;
 import java.util.Locale;
 
 public class AlfrescoAuthorityConnector extends BaseAuthorityConnector {
@@ -119,12 +120,15 @@ public class AlfrescoAuthorityConnector
       AlfrescoUser permissions = alfrescoClient.fetchUserAuthorities(userName);
       if (permissions.getUsername() == null
           || permissions.getUsername().isEmpty()
-          || permissions.getAuthorities().isEmpty())
+          || permissions.getAuthorities().isEmpty()) {
         return RESPONSE_USERNOTFOUND;
-      else
+      } else {
+        final List<String> rval = new ArrayList<>(permissions.getAuthorities());
+        rval.add(permissions.getUsername());
         return new AuthorizationResponse(
-            permissions.getAuthorities().toArray(new String[permissions.getAuthorities().size()]),
+            rval.toArray(new String[rval.size()]),
             AuthorizationResponse.RESPONSE_OK);
+      }
     } catch (AlfrescoDownException e) {
       return RESPONSE_UNREACHABLE;
     }



Mime
View raw message