modified: helpers/functions/isFreePublicClaim.js

list of allowable licenses is now an array
This commit is contained in:
caseyparker 2017-07-23 16:52:16 -07:00
parent 1455d63047
commit 2a10baf72c

View file

@ -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;