Skip to content
Snippets Groups Projects
Commit fd4b4f45 authored by Gabriel Engel's avatar Gabriel Engel Committed by GitHub
Browse files

Merge pull request #6234 from nishimaki10/bugfix-delete-uploads

Bugfix: Cannot remove uploads of other users
parents 67e2611a 70e25198
No related branches found
Tags xwiki-platform-13.4-rc-1
No related merge requests found
......@@ -6,7 +6,7 @@ UploadFS.config.defaultStorePermissions = new UploadFS.StorePermissions({
return userId;
},
update: function(userId, doc) {
return userId === doc.userId;
return RocketChat.authz.hasPermission(Meteor.userId(), 'delete-message', doc.rid) || (RocketChat.settings.get('Message_AllowDeleting') && userId === doc.userId);
},
remove: function(userId, doc) {
return RocketChat.authz.hasPermission(Meteor.userId(), 'delete-message', doc.rid) || (RocketChat.settings.get('Message_AllowDeleting') && userId === doc.userId);
......
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