You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2016/07/13 05:09:42 UTC

[04/24] incubator-guacamole-client git commit: GUACAMOLE-5: Provide UserContext to DirectoryObjectResourceFactory, in case needed by a particular resource (such as for additional permission checks).

GUACAMOLE-5: Provide UserContext to DirectoryObjectResourceFactory, in case needed by a particular resource (such as for additional permission checks).

Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/bca4e34b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/bca4e34b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/bca4e34b

Branch: refs/heads/master
Commit: bca4e34b512e5b3935ffd41c94d14b95100d898c
Parents: f440f55
Author: Michael Jumper <mj...@apache.org>
Authored: Tue Jul 12 00:31:52 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue Jul 12 00:31:52 2016 -0700

----------------------------------------------------------------------
 .../rest/directory/DirectoryObjectResourceFactory.java        | 7 ++++++-
 .../apache/guacamole/rest/directory/DirectoryResource.java    | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/bca4e34b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResourceFactory.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResourceFactory.java b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResourceFactory.java
index ba17382..613ac42 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResourceFactory.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryObjectResourceFactory.java
@@ -21,6 +21,7 @@ package org.apache.guacamole.rest.directory;
 
 import org.apache.guacamole.net.auth.Directory;
 import org.apache.guacamole.net.auth.Identifiable;
+import org.apache.guacamole.net.auth.UserContext;
 
 /**
  * Factory which creates DirectoryObjectResource instances exposing objects of
@@ -40,6 +41,9 @@ public interface DirectoryObjectResourceFactory<InternalType extends Identifiabl
     /**
      * Creates a new DirectoryObjectResource which exposes the given object.
      *
+     * @param userContext
+     *     The UserContext which contains the given Directory.
+     *
      * @param directory
      *     The Directory which contains the object being exposed.
      *
@@ -51,6 +55,7 @@ public interface DirectoryObjectResourceFactory<InternalType extends Identifiabl
      *     A new DirectoryObjectResource which exposes the given object.
      */
     DirectoryObjectResource<InternalType, ExternalType>
-        create(Directory<InternalType> directory, InternalType object);
+        create(UserContext userContext, Directory<InternalType> directory,
+                InternalType object);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/bca4e34b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java
index 5f726f6..ee4fd2c 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java
@@ -258,7 +258,7 @@ public class DirectoryResource<InternalType extends Identifiable, ExternalType>
             throw new GuacamoleResourceNotFoundException("Not found: \"" + identifier + "\"");
 
         // Return a resource which provides access to the retrieved object
-        return resourceFactory.create(directory, object);
+        return resourceFactory.create(userContext, directory, object);
 
     }