-
Notifications
You must be signed in to change notification settings - Fork 170
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
Fix admin actions visibility for non admin mods #1412
Conversation
!subList.contains(creatorId) | ||
} | ||
} else { | ||
// You can do moderator actions only on the mods added after you. |
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.
Does the moderator hierarchy not apply to admins? i.e. Any admin can moderate any admin?
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.
It does apply to other admins. Check L28 and L35, it adds admins, then mods for the ordered hierarchy.
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.
It's not about the code, but rather does Lemmy also have the hierarchy for admin. (so yes I assume)
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.
Yep admins also have a hierarchy.
!subList.contains(creatorId) | ||
} | ||
} else { | ||
// You can do moderator actions only on the mods added after you. |
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.
It does apply to other admins. Check L28 and L35, it adds admins, then mods for the ordered hierarchy.
* | ||
* So this is QoL were we simulate the mods of the community | ||
* It is not completely accurate as it doesn't take into account the hierarchy of mods | ||
*/ |
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.
This really shows that the canMod
logic needs to be added on the back-end: LemmyNet/lemmy#4365
Once I eventually get some time to work on that, we'd be able to remove the mod list from almost every response, and stuff like this.
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.
One thing I forgot, how does the self
option play into this? Which mod actions can you do on yourself? like lockpost? How would that work with canMod from server side?
Currently we don't do that correctly either. canMod should probably return which actions can be done?
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.
I just looked through the lemmy-ui code, and its only distinguish
that you can do to yourself, and anyone lower than you. We could probably change that to just isModOrAdmin && myComment
, and remove the onSelf
attribute.
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.
Only distinguish? Can top admin not pin his own comment? Or lock/feature his own posts?
Fix #1411
Fix #1408
Fixed some admin actions being shown to non admin mods
Did more deep research into the non admin can't ban user from community. I couldn't reproduce this at all. User was certain though it was a community ban and not a instance ban
Added a simulateModerators only for post options popup menu, it is not completely correct but this way non admin mods which probably make up most of the mods can actually moderate from the main feed. In case of the edge case moderator moderates a higher mod, the call will fail. So not that bad
Also fixed the weird movement of the post when opening the morePostOptions menu (regression)
see https://stackoverflow.com/questions/77010371/prevent-popup-from-adding-padding-in-a-column-with-arrangement-spacedbylarge-p