Commit b50f0ae9 authored by ale's avatar ale

Do not disable mailing lists when disabling a user

Mailing lists have a slightly different concept of "ownership" and we
shouldn't automatically disable them.

Fixes issue #16.
parent e5d36de1
Pipeline #7172 passed with stages
in 2 minutes and 5 seconds
......@@ -277,8 +277,13 @@ func (r *DisableUserRequest) Serve(rctx *RequestContext) (interface{}, error) {
return nil, errors.New("user is already inactive")
}
// Disable all resources.
// Disable all resources except for lists/newsletters, which
// may have multiple ownership and in general have slightly
// different "ownership" semantics than other resources.
for _, rsrc := range user.Resources {
if rsrc.Type == ResourceTypeMailingList || rsrc.Type == ResourceTypeNewsletter {
continue
}
if rsrc.Status == ResourceStatusActive || rsrc.Status == ResourceStatusReadonly {
rsrc.Status = ResourceStatusInactive
if err := rctx.TX.UpdateResource(rctx.Context, rsrc); err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment