Fix rename-room script to make sure it updates permissions to inherit from the new group
When we use the rename-room
script to change a room over to a new group, it fails to update the security descriptor to point to the new room if the permissions are inherited from the group.
db.troupes.findOne({ lcUri: 'rogeriotaques/mailshield' })
{
"sd" : {
"internalId" : ObjectId("xxx"),
"extraAdmins" : [ ],
"extraMembers" : [ ],
"members" : "PUBLIC",
"public" : true,
"admins" : "GROUP_ADMIN",
"type" : "GROUP"
},
}
Solution
When we are renaming a type" : "GROUP"
room, make sure to update internalId
to point to the newGroup