Skip to content
Snippets Groups Projects
Commit 5c0c1f9a authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Anonymous Write: Fix permissions

parent de4b10a9
No related merge requests found
......@@ -47,10 +47,10 @@ Meteor.startup(function() {
{ _id: 'set-owner', roles : ['admin', 'owner'] },
{ _id: 'unarchive-room', roles : ['admin'] },
{ _id: 'view-c-room', roles : ['admin', 'user', 'bot', 'anonymous'] },
{ _id: 'view-d-room', roles : ['admin', 'user', 'bot', 'anonymous'] },
{ _id: 'view-d-room', roles : ['admin', 'user', 'bot'] },
{ _id: 'view-full-other-user-info', roles : ['admin'] },
{ _id: 'view-history', roles : ['admin', 'user', 'anonymous'] },
{ _id: 'view-joined-room', roles : ['guest', 'bot'] },
{ _id: 'view-joined-room', roles : ['guest', 'bot', 'anonymous'] },
{ _id: 'view-join-code', roles : ['admin'] },
{ _id: 'view-logs', roles : ['admin'] },
{ _id: 'view-other-user-channels', roles : ['admin'] },
......
......@@ -8,5 +8,25 @@ RocketChat.Migrations.add({
RocketChat.models.Settings.update({ _id: 'Accounts_AllowAnonymousRead' }, { $set: { value: setting.value } });
}
}
const query = {
_id: {
$in: [
'view-c-room',
'view-history',
'view-joined-room',
'view-p-room',
'preview-c-room'
]
}
};
const update = {
$addToSet: {
roles: 'anonymous'
}
};
RocketChat.models.Permissions.update(query, update, { multi: true });
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment