Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Fix users with `lists:get_all` and `:get` seeing '*Unknown' mask on list names. Closes #3016.

Kailash Nadhd89b4102aec6
diff --git a/cmd/subscribers.go b/cmd/subscribers.go
index 34bc7810..be242f0f 100644
--- a/cmd/subscribers.go
+++ b/cmd/subscribers.go
@@ -752,10 +752,10 @@ func (a *App) exportSubscriberData(id int, subUUID string, exportables map[strin
}
// maskRestrictedSubLists replaces list names with "*Unknown" for lists
-// the user doesn't have manage permission on. This appears on the subscriber
+// the user doesn't have read access to. This appears on the subscriber
// details UI and prevents users without access to certain lists from seeing their names.
func maskRestrictedSubLists(user auth.User, sub *models.Subscriber) {
- if user.HasPerm(auth.PermListManageAll) {
+ if user.HasPerm(auth.PermListManageAll) || user.HasPerm(auth.PermListGetAll) {
return
}
@@ -767,7 +767,8 @@ func maskRestrictedSubLists(user auth.User, sub *models.Subscriber) {
for i, l := range lists {
id, _ := l["id"].(float64)
- if user.HasListPerm(auth.PermTypeManage, int(id)) != nil {
+ if user.HasListPerm(auth.PermTypeGet, int(id)) != nil &&
+ user.HasListPerm(auth.PermTypeManage, int(id)) != nil {
lists[i]["name"] = "*Unknown"
lists[i]["restricted"] = true
delete(lists[i], "description")