chore!: Remove deprecated authorization:removeUserFromRole method (#36864)

This commit is contained in:
Martin Schoeler 2025-09-03 17:24:22 -03:00 committed by Guilherme Gazzo
parent aa0ac729b1
commit 1631693642
3 changed files with 5 additions and 19 deletions

View File

@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": major
---
Removes the deprecated `authorization:removeUserFromRole` method

View File

@ -6,7 +6,6 @@ import './methods/addPermissionToRole';
import './methods/addUserToRole'; import './methods/addUserToRole';
import './methods/deleteRole'; import './methods/deleteRole';
import './methods/removeRoleFromPermission'; import './methods/removeRoleFromPermission';
import './methods/removeUserFromRole';
import './streamer/permissions'; import './streamer/permissions';
export { getRoles, getUsersInRole, subscriptionHasRole, canAccessRoomAsync, roomAccessAttributes }; export { getRoles, getUsersInRole, subscriptionHasRole, canAccessRoomAsync, roomAccessAttributes };

View File

@ -1,6 +1,5 @@
import { api } from '@rocket.chat/core-services'; import { api } from '@rocket.chat/core-services';
import type { IRole, IUser } from '@rocket.chat/core-typings'; import type { IRole, IUser } from '@rocket.chat/core-typings';
import type { ServerMethods } from '@rocket.chat/ddp-client';
import { Roles, Users } from '@rocket.chat/models'; import { Roles, Users } from '@rocket.chat/models';
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
@ -94,20 +93,3 @@ export const removeUserFromRole = async (userId: string, roleId: string, usernam
return remove; return remove;
}; };
Meteor.methods<ServerMethods>({
async 'authorization:removeUserFromRole'(roleId, username, scope) {
methodDeprecationLogger.method('authorization:removeUserFromRole', '8.0.0', '/v1/roles.removeUserFromRole');
const userId = Meteor.userId();
if (!userId) {
throw new Meteor.Error('error-action-not-allowed', 'Access permissions is not allowed', {
method: 'authorization:removeUserFromRole',
action: 'Accessing_permissions',
});
}
return removeUserFromRole(userId, roleId, username, scope);
},
});