mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-27 22:40:49 +00:00
chore!: Remove deprecated authorization:removeUserFromRole method (#36864)
This commit is contained in:
parent
aa0ac729b1
commit
1631693642
5
.changeset/dull-rabbits-add.md
Normal file
5
.changeset/dull-rabbits-add.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@rocket.chat/meteor": major
|
||||
---
|
||||
|
||||
Removes the deprecated `authorization:removeUserFromRole` method
|
||||
@ -6,7 +6,6 @@ import './methods/addPermissionToRole';
|
||||
import './methods/addUserToRole';
|
||||
import './methods/deleteRole';
|
||||
import './methods/removeRoleFromPermission';
|
||||
import './methods/removeUserFromRole';
|
||||
import './streamer/permissions';
|
||||
|
||||
export { getRoles, getUsersInRole, subscriptionHasRole, canAccessRoomAsync, roomAccessAttributes };
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { api } from '@rocket.chat/core-services';
|
||||
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 { Meteor } from 'meteor/meteor';
|
||||
|
||||
@ -94,20 +93,3 @@ export const removeUserFromRole = async (userId: string, roleId: string, usernam
|
||||
|
||||
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);
|
||||
},
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user