The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/server/startup/migrations/v027.coffee

10 lines
395 B

RocketChat.Migrations.add
version: 27
up: ->
RocketChat.models.Users.update({}, { $rename: { roles: '_roles' } }, { multi: true })
RocketChat.models.Users.find({ _roles: { $exists: 1 } }).forEach (user) ->
for scope, roles of user._roles
RocketChat.models.Roles.addUserRoles(user._id, roles, scope)
RocketChat.models.Users.update({}, { $unset: { _roles: 1 } }, { multi: true })