From 414e3f2ffad523ba174af2b613bb9f1345a0fdd5 Mon Sep 17 00:00:00 2001 From: caseyparker Date: Sun, 23 Jul 2017 16:02:22 -0700 Subject: [PATCH 1/3] modified: views/partials/publish.handlebars --- views/partials/publish.handlebars | 1 + 1 file changed, 1 insertion(+) diff --git a/views/partials/publish.handlebars b/views/partials/publish.handlebars index fd18d89b..9ee2bfae 100644 --- a/views/partials/publish.handlebars +++ b/views/partials/publish.handlebars @@ -20,6 +20,7 @@

From 1455d630478a97772383f7dca7d057e58f1c0a22 Mon Sep 17 00:00:00 2001 From: caseyparker Date: Sun, 23 Jul 2017 16:02:59 -0700 Subject: [PATCH 2/3] modified: helpers/libraries/publishHelpers.js --- helpers/libraries/publishHelpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/libraries/publishHelpers.js b/helpers/libraries/publishHelpers.js index 7652fa1f..29200a7b 100644 --- a/helpers/libraries/publishHelpers.js +++ b/helpers/libraries/publishHelpers.js @@ -30,8 +30,8 @@ module.exports = { throw new Error('The claim name you provided is not allowed. Only the following characters are allowed: A-Z, a-z, 0-9, and "-"'); } // validate license - if ((license.indexOf('Public Domain') === -1) && (license.indexOf('Creative Commons') === -1)) { - throw new Error('Only posts with a license of "Public Domain" or "Creative Commons" are eligible for publishing through spee.ch'); + if ((license.indexOf('Public Domain') === -1) && (license.indexOf('Creative Commons') === -1) && (license.indecOf('CC Attribution-NonCommercial 4.0 International') === -1)) { + throw new Error('Only posts with a "Public Domain" license, or one of the Creative Commons licenses are eligible for publishing through spee.ch'); } switch (nsfw) { case true: From 2a10baf72cc0d3522be3e16f7485a617c1c62ba7 Mon Sep 17 00:00:00 2001 From: caseyparker Date: Sun, 23 Jul 2017 16:52:16 -0700 Subject: [PATCH 3/3] modified: helpers/functions/isFreePublicClaim.js list of allowable licenses is now an array --- helpers/functions/isFreePublicClaim.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/functions/isFreePublicClaim.js b/helpers/functions/isFreePublicClaim.js index d9895814..d8e15894 100644 --- a/helpers/functions/isFreePublicClaim.js +++ b/helpers/functions/isFreePublicClaim.js @@ -1,9 +1,9 @@ const logger = require('winston'); - +const licenses = ['Creative Commons', 'Public Domain', 'CC Attribution-NonCommercial 4.0 International']; module.exports = ({ value }) => { logger.debug('checking isFreePublicClaim ?'); if ( - (value.stream.metadata.license.indexOf('Public Domain') !== -1 || value.stream.metadata.license.indexOf('Creative Commons') !== -1) && + (Array.asList(licenses).contains(value.stream.metadata.license)) && (!value.stream.metadata.fee || value.stream.metadata.fee.amount === 0) ) { return true;