Disallow cloning playlist if user doesn't have seeplaylist permission

This commit is contained in:
Calvin Montgomery 2014-08-02 19:12:09 -07:00
parent 952b2d66d3
commit 84a07030d0
1 changed files with 6 additions and 0 deletions

View File

@ -1211,6 +1211,12 @@ PlaylistModule.prototype.handleClonePlaylist = function (user, data) {
});
}
if (!this.channel.modules.permissions.canSeePlaylist(user)) {
return user.socket.emit("errorMsg", {
msg: "You are not allowed to save this playlist"
});
}
var pl = this.items.toArray();
var self = this;
db.saveUserPlaylist(pl, user.getName(), data.name, function (err) {