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)
This commit is contained in:
Ralf Haferkamp
2022-02-02 16:43:26 +01:00
parent 9923f1f133
commit f7d290c131

View File

@@ -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.