@@ -7,9 +7,6 @@ import { Meteor } from 'meteor/meteor';
77import type { ClientSession } from 'mongodb' ;
88import _ from 'underscore' ;
99
10- import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission' ;
11- import { settings } from '../../../settings/server' ;
12- import { RateLimiter } from '../lib' ;
1310import { addUserToRoom } from './addUserToRoom' ;
1411import { checkUsernameAvailability } from './checkUsernameAvailability' ;
1512import { getAvatarSuggestionForUser } from './getAvatarSuggestionForUser' ;
@@ -20,6 +17,7 @@ import { validateUsername } from './validateUsername';
2017import { callbacks } from '../../../../lib/callbacks' ;
2118import { onceTransactionCommitedSuccessfully } from '../../../../server/database/utils' ;
2219import { SystemLogger } from '../../../../server/lib/logger/system' ;
20+ import { settings } from '../../../settings/server' ;
2321import { notifyOnUserChange } from '../lib/notifyListener' ;
2422
2523export const setUsernameWithValidation = async ( userId : string , username : string , joinDefaultChannelsSilenced ?: boolean ) : Promise < void > => {
@@ -151,10 +149,3 @@ export const _setUsername = async function (
151149
152150 return user ;
153151} ;
154-
155- export const setUsername = RateLimiter . limitFunction ( _setUsername , 1 , 60000 , {
156- async 0 ( ) {
157- const userId = Meteor . userId ( ) ;
158- return ! userId || ! ( await hasPermissionAsync ( userId , 'edit-other-user-info' ) ) ;
159- } ,
160- } ) ;
0 commit comments