mimetype: $el.attr('data-mime'),
type: $el.attr('data-type'),
size: parseInt($el.attr('data-size'), 10),
- etag: $el.attr('data-etag')
+ etag: $el.attr('data-etag'),
+ permissions: parseInt($el.attr('data-permissions'), 10)
};
},
this.$el.find('.selectedActions').addClass('hidden');
}
else {
- canDelete = (this.getDirectoryPermissions() & OC.PERMISSION_DELETE);
+ canDelete = (this.getDirectoryPermissions() & OC.PERMISSION_DELETE) && this.isSelectedDeletable();
this.$el.find('.selectedActions').removeClass('hidden');
this.$el.find('#headerSize a>span:first').text(OC.Util.humanFileSize(summary.totalSize));
var selection = '';
}
},
+ /**
+ * Check whether all selected files are deletable
+ */
+ isSelectedDeletable: function() {
+ return _.reduce(this.getSelectedFiles(), function(deletable, file) {
+ return deletable && (file.permissions & OC.PERMISSION_DELETE);
+ }, true);
+ },
+
/**
* Returns whether all files are selected
* @return true if all files are selected, false otherwise