Fix ACL editor

PR #1610 introduces many bugs breaking the feature.
This PR fixes them.