Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加密文章更新后没有删除访问权限 #1518

Closed
1379 opened this issue Nov 4, 2021 · 14 comments · Fixed by #1540
Closed

加密文章更新后没有删除访问权限 #1518

1379 opened this issue Nov 4, 2021 · 14 comments · Fixed by #1540
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. pr welcome
Milestone

Comments

@1379
Copy link

1379 commented Nov 4, 2021

What is version of Halo has the issue?

latest

What database are you using?

MySQL 8.x

What is your deployment method?

Fat Jar

Your site address.

no

What happened?

代码在这里:

authorizationService.deletePostAuthorization(post.getId());

这里似乎删除了个寂寞。文章更新后,只删除了当前更新文章的人的权限,也就是说删除了管理员的权限。期望的行为应该是删除所有人对这篇文章的权限吧

Relevant log output

No response

Additional information

No response

@1379 1379 added the kind/bug Categorizes issue or PR as related to a bug. label Nov 4, 2021
@ruibaby
Copy link
Member

ruibaby commented Nov 4, 2021

欢迎提交 pr。

@1379
Copy link
Author

1379 commented Nov 4, 2021

@ruibaby 首先我要确定下,这是一个bug吗?我的判断是正确的吗

@ruibaby
Copy link
Member

ruibaby commented Nov 4, 2021

已确认可以复现。

@JohnNiang
Copy link
Member

@1379 建议提供一个复现步骤,我们好确定问题是一样的。

@1379
Copy link
Author

1379 commented Nov 4, 2021

@JohnNiang 打开两个浏览器。其中一个访问加密文章,输入密码,可以访问。在另一个浏览器里使用管理员登录,修改加密文章的密码,然后回到刚才的浏览器,访问加密文章,不需要输入密码就可以访问。

@1379
Copy link
Author

1379 commented Nov 4, 2021

这是我在看源码时发现的问题

@1379
Copy link
Author

1379 commented Nov 4, 2021

有人正在修复这个问题吗,我可以提个pr

@ruibaby
Copy link
Member

ruibaby commented Nov 4, 2021

有人正在修复这个问题吗,我可以提个pr

没有

@1379
Copy link
Author

1379 commented Nov 4, 2021

你们有开发者交流群组吗,我可以加入吗。最近看源码有一些自己的思考想交流下

@ruibaby
Copy link
Member

ruibaby commented Nov 4, 2021

你们有开发者交流群组吗,我可以加入吗。最近看源码有一些自己的思考想交流下

在 issue 交流即可。

@JohnNiang
Copy link
Member

你们有开发者交流群组吗,我可以加入吗。最近看源码有一些自己的思考想交流下

建议公开交流,这样也能留下讨论记录,更多人能够看到你的想法,有机会和你探讨。

建议在留言的时候把观点或者问题描述清楚,给对方足够多的信息,这样能避免一些反复来回沟通。

@1379
Copy link
Author

1379 commented Nov 4, 2021

我发现这个问题有些麻烦

诉求是在更新加密文章时删除所有人对这篇文章的权限。
现在权限是存储在缓存里的 key:sessionID -> value:postID 。
如果想删除所有人对这篇文章的权限,需要根据postID 查到所有的sessionID。
那怎么根据postID 来反查 sessionID 呢?
如果把postID 作为key,value是HashSet,set里面存储sessionID,这样确实可以根据postID 反查到 sessionID,但是也引来了新的问题,因为不能对HashSet里的子项设置过期时间,这个HashSet可能会越来越大。。
有人有好的解决办法吗

@ruibaby
Copy link
Member

ruibaby commented Nov 8, 2021

cc @zhixiangyuan

@ruibaby
Copy link
Member

ruibaby commented Nov 18, 2021

/assign @guqing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. pr welcome
Projects
None yet
4 participants