From 4a16c09c46ed2b745962f709f3dcaf7003be928d Mon Sep 17 00:00:00 2001 From: canonical Date: Wed, 22 Jan 2025 18:39:52 +0800 Subject: [PATCH] =?UTF-8?q?xui:permissions=E8=BD=AC=E6=8D=A2=E4=B8=BAxui:r?= =?UTF-8?q?oles=E4=B9=8B=E5=90=8E=E4=B8=8E=E5=B7=B2=E6=9C=89=E7=9A=84xui:r?= =?UTF-8?q?oles=E5=90=88=E5=B9=B6=EF=BC=8C=E5=B9=B6=E4=B8=94=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E4=B8=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nop-web/src/main/java/io/nop/web/page/PageProvider.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nop-web/src/main/java/io/nop/web/page/PageProvider.java b/nop-web/src/main/java/io/nop/web/page/PageProvider.java index e1375c494..147a09449 100644 --- a/nop-web/src/main/java/io/nop/web/page/PageProvider.java +++ b/nop-web/src/main/java/io/nop/web/page/PageProvider.java @@ -18,6 +18,7 @@ import io.nop.commons.concurrent.executor.ExecutorHelper; import io.nop.commons.concurrent.executor.GlobalExecutors; import io.nop.commons.lang.impl.Cancellable; +import io.nop.commons.util.CollectionHelper; import io.nop.commons.util.StringHelper; import io.nop.core.CoreConstants; import io.nop.core.i18n.I18nMessageManager; @@ -186,7 +187,7 @@ public Map getPage(String path, String locale) { return data; } - Object transformPermissions(Object value) { + protected Object transformPermissions(Object value) { Map map = (Map) value; Object perms = map.remove(WebConstants.ATTR_XUI_PERMISSIONS); if (perms == null) @@ -194,7 +195,9 @@ Object transformPermissions(Object value) { Set permissions = ConvertHelper.toCsvSet(perms); Set roles = rolePermissionMapping.getRolesWithPermission(permissions); - map.put(WebConstants.ATTR_XUI_ROLES, roles); + Set oldRoles = ConvertHelper.toCsvSet(map.get(WebConstants.ATTR_XUI_ROLES)); + Set merged = CollectionHelper.mergeSet(roles, oldRoles); + map.put(WebConstants.ATTR_XUI_ROLES, merged); return map; }