ロールポリシーを増やす
Summary
https://activitypub.software/TransFem-org/Sharkey/-/issues/669 から
ほぼそのまま転載しただけなので、ここでどれが要りそうでどれが要らなさそうかを検討したい
主にモデレーション方面で使えそうなロールポリシーを増やして、より柔軟に運用できるようにしたい
原文
I'd like to extend the role permission system to allow for more flexibility. The idea behind this is that for my instance in particular, I would like a light variant of "suspend" that does not deactivate the actor, more-so puts the account in a stasis/hold. I also have a role for new users called "sprout" that restricts some of the things that new users are able to do. I would like to remove new users' ability to DM until after the first week on the instance. There is also the possibility that I want to make an audit role that prohibits changing of password, account deletion. The permissions I would like to be able to have in order to account for this:
Reactions
I would like the ability to restrict a user's ability to react to a post. We have existing functionality (emojis marked as sensitive cannot be used as a reaction to posts with nonsensitive reaction levels). I propose the following permission booleans:
canReactcanLike
The reason for keeping "canreact" and "canlike" separate is because I think it's important to allow liking of posts (it's also part of the sensitivity levels - you can set it to allow likes only from remote instances). In the case that CanReact == false the only allowable reactions should be the default reaction inherited by instance settings instead of the user override. CanLike == false just disables the ability to react all together. In the UI, when these permissions are disabled it would be nice to hide the reaction button (and, in the API it would be nice to have a response for 403 that says you're missing the appropriate permissions)
Posting
I would like to have the ability to restrict what a user is able to post.
canQuote- This should be fairly easy, the api treats quotes/renotes as the same (renoteId is specified with text set to null or something specific)
canRenote(I don't care what it's called at the end of the day)- Check renoteId
canReply- Check replyId
- (注:もうあるかも。canInitiateConversation?)
canDirectNote- Check Visibility, and check that VisibileUserIds == [] or null
canUnlistedNote- Check Visibility
- (注:これは何)
canFederateNote- Check localOnly
canAttachFiles- Check (fileIds == null || fileIds == []) && (mediaIds == null || mediaIds == [])
Emojis
canUseCustomEmojis- During resolution check if there's any emojis (custom, idc about unicode don't waste your time) if so do not resolve them. emojis such as :dabmeup: and others should realistically just show as text (I believe the server actually attaches the emoji urls in the note json but I don't remember for sure)
canUseSensitiveEmojis- Whether the user can use sensitive emojis at all (if an emoji is marked as sensitive just don't render it using the same code as before)
Pages
pageLimit- Looking at instance meta, I don't see where the page limit is in policy? Maybe I'm missing something. Either way, the ability to remove users' page creation is something I want implemented.
- (注:もうIssueがある https://github.com/misskey-dev/misskey/issues/14212 )
Channels
canNoteToChannel- Whether the user can create a note in a channel. Check channelId
Account
canDeleteAccount- Whether the user can delete their account
canChangePassword- Whether the user can change their password
canRevokeToken- Whether the user can revoke
ivia regenerate-token or revoke-token
- Whether the user can revoke
canChangeEmail- Whether the user can change their email
canClaimAchievement- Whether the user can use i/claim-achievement
- (注:本流では必要なさそう)
canChangeName- Whether the user can use i/update to change name
canChangeDescription- Whether the user can use i/update to change description
canChangeFields- Whether the user can use i/update to change fields
canChangeAvatar- Whether the user can use i/update to change avatar
canChangeBanner- Whether the user can use i/update to change banner
- CanChangeBackground
- Whether the user can use i/update to change background
- (注:Misskeyには存在しない概念のため本流では必要なさそう)
canChangeStatus- Whether the user can use i/update to hide online status
canAutoFollow- Whether the user can use i/update to restrict/unrestrict follow requests
canPinPage- Whether the user can use i/update to pin a page
canChangeExplorable- Whether the user can use i/update to change their explorable setting
canChangeFollowingVisibility- Whether the user can use i/update to change their following visibility
canChangeFollowerVisibility- Whether the user can use i/update to change their follower visibility
canFollow- Whether the user can follow other users
canBeFollowed- Whether the user can be followed (just reject follow if not lol)
canUnfollow- Whether the user can unfollow other users
canRejectFollowRequests- Whether the user can reject follow requests
Drive
canCreateFolders- Whether the user can create drive folders
canDeleteFolders- Whether the user can delete drive folders
canDeleteFiles- Whether the user can delete drive files
canAccessDrive- Whether the user can access the drive menu at all.
The reason I did not include canCreateFiles is because you can already accomplish this restriction by setting the upload capacity (in MB) to 0.
Purpose
It would help with provide instance administration much needed granular permissions to better control the interactions they want on their instance. Consider someone who runs a sharkey (misskey) instance but does not like the custom reactions, they can disable them entirely.
(サーバー管理に便利なきめ細かなロールポリシーを提供することで、サーバー上でのインタラクションをよりよくコントロールできるようになる。例えばMisskeyを使いたいがリアクションは好まない…というようなユースケースでも追加の改造無しで対応可能になる)
Do you want to implement this feature yourself?
- [ ] Yes, I will implement this by myself and send a pull request
canUnlistedNote
多分ホーム投稿できるかどうか?
from: #14957
- ノート禁止(個別の設定は一部あるようですが、全部は塞げていなさそう)
- アクセストークンを使用した読み取りの禁止
- 元投稿ではリクエストの禁止と書いてましたが、書き込み・変更があるなら残りは読み取りだけかなと
- アクセストークンを使用した書き込み・変更の禁止
その他
- canQuoteとcanRenoteは統合して良さそう(チェックもしやすそうなので)
- canCreateFolders、フォルダだけ制限する必要性がなさそう…?
- canDeleteFoldersとcanDeleteFilesは不要な気がします(追加だけ出来て消せないのは謎かもしれない…凍結みたいに手を付けられなくする想定なら、canAccessDriveで全部止めて良さそう)
- canChangeAvatarとcanChangeBannerは実質もう生やしたはず…
- ユーザーからフォローを投げた際に、受け取った側の承認が必要なようにするロールポリシーがあると良いかも(サーバーサイレンスとかで発生するやつです)
canQuoteとcanRenoteは統合して良さそう(チェックもしやすそうなので)
リノートはしていいけど引用されるのはやめたい(本人にコメント付きの投稿が通知されてしまうので)という需要は割とありそうな気がする
canCreateFolders、フォルダだけ制限する必要性がなさそう…? canDeleteFoldersとcanDeleteFilesは不要な気がします(追加だけ出来て消せないのは謎かもしれない…凍結みたいに手を付けられなくする想定なら、canAccessDriveで全部止めて良さそう)
そうかも
canChangeAvatarとcanChangeBannerは実質もう生やしたはず…
外せるだけで変更を抑止するものではなかったと記憶している
canQuoteとcanRenoteは統合して良さそう(チェックもしやすそうなので)
リノートはしていいけど引用されるのはやめたい(本人にコメント付きの投稿が通知されてしまうので)という需要は割とありそうな気がする
なるほど〜
canChangeAvatarとcanChangeBannerは実質もう生やしたはず…
外せるだけで変更を抑止するものではなかったと記憶している
外す機能とは別に、 #14078 でやったはず…?
外す機能とは別に、 https://github.com/misskey-dev/misskey/pull/14078 でやったはず…?
ほんまや
revisit: モデレーションを行う中で、一覧に挙げられているリアクション抑制用のロール権限が欲しい場面がありました
そもそもノートを許可するかどうかのポリシーってありそうでない?