From f7d290c131871b070c787a5b1877f03b76572765 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 2 Feb 2022 16:43:26 +0100 Subject: [PATCH] Implement CS3 stub for /users/{userid}/groups Up to now when using the CS3 backend (e.g. to use an external LDAP server) queries to /users/{userid}/groups just errored out. This add a simple stub to just return and empty group list for now. This allows using and external LDAP server without having to fiddle with the proxy configuration to redirect to the reva ocs implementation. (Which also is just returning an empty group list currently) --- ocs/pkg/service/v0/groups.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ocs/pkg/service/v0/groups.go b/ocs/pkg/service/v0/groups.go index 826440813..1eb2ddd48 100644 --- a/ocs/pkg/service/v0/groups.go +++ b/ocs/pkg/service/v0/groups.go @@ -30,6 +30,11 @@ func (o Ocs) ListUserGroups(w http.ResponseWriter, r *http.Request) { } var account *accountsmsg.Account + if o.config.AccountBackend == "cs3" { + o.mustRender(w, r, response.DataRender(&data.Groups{})) + return + } + // short circuit if there is a user already in the context if u, ok := revactx.ContextGetUser(r.Context()); ok { // we are not sure whether the current user in the context is the admin or the authenticated user.