-
Notifications
You must be signed in to change notification settings - Fork 11k
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: Fix admin delete group API call #34909
base: develop
Are you sure you want to change the base?
fix: Fix admin delete group API call #34909
Conversation
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
Before you submit a PR you should check in open whether your PR would be accepted. It will save you a lot of wasted time and energy. I suspect this is another case of stopping admins 'meddling' with other peoples stuff in the name of 'privacy'. However, I do believe Rocket should remember who is actually owner of the server and let them decide what they can or can't do. What happens if the private chat is NSFW and the admin wants to delete it because it is hosting illegal material ? So it may be appropriate to restrict admin permissions in a 'public' server. But many orgs there are no 'public' users, and there is no such thing as 'private'. If it is my company I will view what I want. I may be legally forced to do so (think GDPR etc). In which the many 'admin' restrictions are inappropriate. Possibly there should be an unrestricted 'super admin' role above admin. |
Thank you for your feedback and for raising the important issue of balancing admin permissions with privacy. The intent of this PR is to resolve a specific bug (#16954) by refining the permission checks and error handling for the groups.delete API call. I also want to mention that I’m new to this open-source community and still learning how to submit PRs that align with the community’s standards and expectations. If there are specific changes or improvements I can make to this PR to ensure it gets accepted, I would be incredibly grateful for your guidance. I completely understand the need to consider broader implications, such as scenarios involving sensitive or illegal content in private groups. Your suggestion of a "super admin" role is a valuable idea and could be worth exploring as part of a future enhancement. For now, this PR aims to address the immediate issue without making broader changes to the permissions model. I’d appreciate your support in moving this forward, and I’m happy to contribute to further discussions or proposals on enhancing admin roles. |
We'll review this with Product and Engineering |
API Enhancement: Improve groups.delete Permission Handling and Error Messages
Proposed changes
This pull request modifies the behavior of the API call for deleting a group in Rocket.Chat to handle cases where the user is not found or does not have access to the room or user is a admin and is not part of the group. Specifically, we updated the following:
user-not-found
error if the user is not found androom-not-found
if the user does not have the required permissions for the room.This change should improve the reliability of the
groups.delete
API by providing clearer error messages when an operation is not permitted.Issue(s)
Fixes #16954 - Groups deletion API fails for admin users when they're not members of the private group, even with proper admin permissions.
Steps to Reproduce Original Issue
Setup Prerequisites
Create Test Environment
API Testing Steps
Expected vs Actual Behavior
Steps to Test Fix
groups.listAll
API to retrieve a list of groups.groups.delete
API, passing in the group ID.user-not-found
error is thrown.room-not-found
error is thrown.Implementation Details
Code Changes:
Further comments
The key change in this PR is the role check condition, ensuring that the user is either an admin or has specific access to the room. This should prevent unnecessary errors and provide more explicit feedback to the user when attempting to delete a group.
Testing Checklist