]> source.dussan.org Git - gitblit.git/commitdiff
Fix for #993 LIST_BRANCHES without admin 994/head
authorBoris Stumm <bs@kedev.eu>
Wed, 6 Jan 2016 12:51:19 +0000 (13:51 +0100)
committerBoris Stumm <bs@kedev.eu>
Wed, 6 Jan 2016 12:51:19 +0000 (13:51 +0100)
Replaced the canAccess() method in RpcFilter with !adminRequest,
that should solve the problem.

src/main/java/com/gitblit/servlet/RpcFilter.java

index 34474d55e2d425584d67b611983b78f48fa4f24b..355bcb96a49e79145fdb4c2added10c8fb359c41 100644 (file)
@@ -128,7 +128,7 @@ public class RpcFilter extends AuthenticationFilter {
                                return;\r
                        } else {\r
                                // check user access for request\r
-                               if (user.canAdmin() || canAccess(user, requestType)) {\r
+                               if (user.canAdmin() || !adminRequest) {\r
                                        // authenticated request permitted.\r
                                        // pass processing to the restricted servlet.\r
                                        newSession(authenticatedRequest, httpResponse);\r
@@ -153,15 +153,4 @@ public class RpcFilter extends AuthenticationFilter {
                // pass processing to the restricted servlet.\r
                chain.doFilter(authenticatedRequest, httpResponse);\r
        }\r
-\r
-       private boolean canAccess(UserModel user, RpcRequest requestType) {\r
-               switch (requestType) {\r
-               case GET_PROTOCOL:\r
-                       return true;\r
-               case LIST_REPOSITORIES:\r
-                       return true;\r
-               default:\r
-                       return user.canAdmin();\r
-               }\r
-       }\r
-}
\ No newline at end of file
+}\r