mirror of https://github.com/halo-dev/halo
![]() #### What type of PR is this? /kind improvement /area core #### What this PR does / why we need it: 修复角色模板规则改动后用户权限不更新的问题 - 权限校验的地方由原来的从角色 annotations 获取聚合 rules 改为根据角色名称查询所有依赖角色再判断 - console 端获取 UI 权限的地方由获取聚合的 ui-permissions annotation 改为根据角色名称查询所有依赖角色组合后再返回 see #3325 for more detail. 问题描述: 1. 创建一个角色比如叫 test-role 将其分配给一个新用户 2. 安装插件 [plugin-links-1.1.0.jar.zip](https://github.com/halo-dev/halo/files/10856628/plugin-links-1.1.0.jar.zip),该插件提供了一个角色模板配置了 links 但没有配置 groups,当将此插件的查看权限分配给 test-role 后,test-role 会提示 groups 403无权限 3. 使用[plugin-links-1.1.0-after.jar.zip](https://github.com/halo-dev/halo/files/10856695/plugin-links-1.1.0-after.jar.zip) 升级插件后写了,插件已经修复了 gorups 的权限模板配置,期望 test-role 到链接管理菜单不会报 groups 403,但实际得到了 403 就是因为 test-role 角色依赖了一些其他角色但其他角色权限的改动没有办法通知到 test-role 去更新 test-role 中聚合的 dependency-rules annotation 4. 综上所述改为了直接查询 how to test it? 1. 根据上述问题描述中的步骤来测试,期望升级插件后能正确查看链接 2. 测试为一些角色分配权限后,拥有此角色的用户能正确访问那些资源不会出现403 3. 用户访问没有权限的资源会 403 #### Which issue(s) this PR fixes: Fixes #3325 #### Does this PR introduce a user-facing change? ```release-note 修复角色模板规则改动后用户权限不更新的问题 ``` |
||
---|---|---|
.github | ||
config/checkstyle | ||
console | ||
docs | ||
gradle/wrapper | ||
hack | ||
src | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
Dockerfile | ||
LICENSE | ||
OWNERS | ||
README.md | ||
SECURITY.md | ||
build.gradle | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
settings.gradle |
README.md
Halo [ˈheɪloʊ],强大易用的开源建站工具。
快速开始
docker run \
-it -d \
--name halo \
-p 8090:8090 \
-v ~/.halo2:/root/.halo2 \
halohub/halo:2.2 \
--halo.external-url=http://localhost:8090/ \
--halo.security.initializer.superadminusername=admin \
--halo.security.initializer.superadminpassword=P@88w0rd
以上仅作为体验使用,详细部署文档请查阅:https://docs.halo.run/getting-started/install/docker-compose
在线体验
- 环境地址:https://demo.halo.run
- 后台地址:https://demo.halo.run/console
- 用户名:
demo
- 密码:
P@ssw0rd123..
生态
可访问 awesome-halo 查看已经适用于 Halo 2.0 的主题和插件,以及适用于 Halo 1.x 的相关仓库。
许可证
Halo 使用 GPL-v3.0 协议开源,请遵守开源协议。
贡献
参考 CONTRIBUTING。