Make delete from channel library a configurable permission

This commit is contained in:
Calvin Montgomery 2017-01-23 21:16:39 -08:00
parent bec55bc3d1
commit b0ff4d5ef0
4 changed files with 9 additions and 10 deletions

View file

@ -893,7 +893,7 @@ Callbacks = {
generator: function (item, page, index) {
var li = makeSearchEntry(item, false);
if(hasPermission("playlistadd")) {
if(hasPermission("playlistadd") || hasPermission("deletefromchannellib")) {
addLibraryButtons(li, item.id, data.source);
}
$(li).appendTo($("#library"));

View file

@ -1121,7 +1121,7 @@ function addLibraryButtons(li, id, source) {
})
.appendTo(btns);
}
if(CLIENT.rank >= 2 && source === "library") {
if(hasPermission("deletefromchannellib") && source === "library") {
$("<button/>").addClass("btn btn-xs btn-danger")
.html("<span class='glyphicon glyphicon-trash'></span>")
.click(function() {
@ -1992,6 +1992,7 @@ function genPermissionsEditor() {
makeOption("Lock/unlock playlist", "playlistlock", modleader, CHANNEL.perms.playlistlock+"");
makeOption("Shuffle playlist", "playlistshuffle", standard, CHANNEL.perms.playlistshuffle+"");
makeOption("Clear playlist", "playlistclear", standard, CHANNEL.perms.playlistclear+"");
makeOption("Delete from channel library", "deletefromchannellib", standard, CHANNEL.perms.deletefromchannellib+"");
addDivider("Polls");
makeOption("Open/Close poll", "pollctl", modleader, CHANNEL.perms.pollctl+"");