mirror of https://github.com/halo-dev/halo
fix: exclude reserved users from global search results (#7486)
* fix: exclude reserved users from global search results Signed-off-by: Ryan Wang <i@ryanc.cc> * Use labelSelector Signed-off-by: Ryan Wang <i@ryanc.cc> --------- Signed-off-by: Ryan Wang <i@ryanc.cc>pull/7494/head v2.21.0-alpha.2
parent
f80487b1d5
commit
c6f19a233f
|
@ -77,23 +77,27 @@ const handleBuildSearchIndex = () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (currentUserHasPermission(["system:users:view"])) {
|
if (currentUserHasPermission(["system:users:view"])) {
|
||||||
coreApiClient.user.listUser().then((response) => {
|
coreApiClient.user
|
||||||
response.data.items.forEach((user) => {
|
.listUser({
|
||||||
fuse.add({
|
labelSelector: ["!halo.run/hidden-user"],
|
||||||
title: user.spec.displayName,
|
})
|
||||||
icon: {
|
.then((response) => {
|
||||||
component: markRaw(IconUserSettings),
|
response.data.items.forEach((user) => {
|
||||||
},
|
fuse.add({
|
||||||
group: t("core.components.global_search.groups.user"),
|
title: user.spec.displayName,
|
||||||
route: {
|
icon: {
|
||||||
name: "UserDetail",
|
component: markRaw(IconUserSettings),
|
||||||
params: {
|
|
||||||
name: user.metadata.name,
|
|
||||||
},
|
},
|
||||||
},
|
group: t("core.components.global_search.groups.user"),
|
||||||
|
route: {
|
||||||
|
name: "UserDetail",
|
||||||
|
params: {
|
||||||
|
name: user.metadata.name,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentUserHasPermission(["system:plugins:view"])) {
|
if (currentUserHasPermission(["system:plugins:view"])) {
|
||||||
|
|
Loading…
Reference in New Issue