diff --git a/package.json b/package.json
index 017f6b4a..6dc2b27e 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
- "version": "3.28.0",
+ "version": "3.28.1",
"repository": {
"url": "http://github.com/calzoneman/sync"
},
diff --git a/src/channel/permissions.js b/src/channel/permissions.js
index 12df2800..d85774b8 100644
--- a/src/channel/permissions.js
+++ b/src/channel/permissions.js
@@ -41,7 +41,8 @@ const DEFAULT_PERMISSIONS = {
drink: 1.5, // Use the /d command
chat: 0, // Send chat messages
chatclear: 2, // Use the /clear command
- exceedmaxitems: 2 // Exceed maximum items per user limit
+ exceedmaxitems: 2, // Exceed maximum items per user limit
+ deletefromchannellib: 2 // Delete channel library items
};
function PermissionsModule(channel) {
@@ -336,11 +337,7 @@ PermissionsModule.prototype.canSetPermissions = function (actor) {
};
PermissionsModule.prototype.canUncache = function (actor) {
- if (actor instanceof User) {
- actor = actor.account;
- }
-
- return actor.effectiveRank >= 2;
+ return this.hasPermission(actor, "deletefromchannellib");
};
PermissionsModule.prototype.canExceedMaxItemsPerUser = function (actor) {
@@ -379,7 +376,8 @@ PermissionsModule.prototype.loadUnregistered = function () {
drink: 0, // Use the /d command
chat: 0, // Send chat messages
chatclear: 2, // Use the /clear command
- exceedmaxitems: 2 // Exceed max items per user
+ exceedmaxitems: 2, // Exceed max items per user
+ deletefromchannellib: 2
};
for (var key in perms) {
diff --git a/www/js/callbacks.js b/www/js/callbacks.js
index d9b54c0b..025fce2b 100644
--- a/www/js/callbacks.js
+++ b/www/js/callbacks.js
@@ -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"));
diff --git a/www/js/util.js b/www/js/util.js
index f9c3429a..095f8829 100644
--- a/www/js/util.js
+++ b/www/js/util.js
@@ -1121,7 +1121,7 @@ function addLibraryButtons(li, id, source) {
})
.appendTo(btns);
}
- if(CLIENT.rank >= 2 && source === "library") {
+ if(hasPermission("deletefromchannellib") && source === "library") {
$("").addClass("btn btn-xs btn-danger")
.html("")
.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+"");