-
Notifications
You must be signed in to change notification settings - Fork 236
feat: General users can't access other user pages #10650
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
base: feat/175627-admin-can-hide-user-pages
Are you sure you want to change the base?
feat: General users can't access other user pages #10650
Conversation
…lity-setting-frontend-component feat: New global setting and frontend component for user page visibility
…-visibility-in-pagetree feat: User pages gets hidden from in the page tree when the user page visibility is set to hide
5a898a4 to
81d11a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
サービス層ではなく route でやりましょう
現状の実装
改修案
判定についてのヒントユーザーページの判定import { isUserPage } from '@growi/core/dist/utils/page-path-utils';必要であれば、同パッケージから isUsersTopPage, isUsersHomepage, isUsersProtectedPages などを利用できる API path の判定API path かどうかは、login-required.js の以下の判定を参考にする // is api path
const baseUrl = req.baseUrl || '';
if (baseUrl.match(/^\/_api\/.+$/)) {
...
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v7.3 ベースのコードのように見える
master ブランチからの乖離が激しいので follow してから再実装してください
a9236ca to
dc1954e
Compare
| user?: IUser, | ||
| showPagesRestrictedByOwner?: boolean, | ||
| showPagesRestrictedByGroup?: boolean, | ||
| hideUserPages?: boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この行は不要ではないか?
| if (isTargetUserPage) return false; | ||
|
|
||
| return true; | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
この filter もうちょっとシンプルに書ける
| }); | ||
| } | ||
|
|
||
| if (pages.length === 0 && path != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path != null という条件はなんのために必要なんだっけ?
fc136ec to
464f9d3
Compare
https://redmine.weseek.co.jp/issues/174756
Block viewing of other user's pages when hiding user pages