MCPcopy Index your code
hub / github.com/codecombat/codecombat / isPublished

Method isPublished

app/models/CocoModel.js:357–363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355 }
356
357 isPublished () {
358 let left
359 for (const permission of Array.from(((left = this.get('permissions', true)) != null ? left : []))) {
360 if ((permission.target === 'public') && (permission.access === 'read')) { return true }
361 }
362 return false
363 }
364
365 publish () {
366 if (this.isPublished()) { throw new Error('Can\'t publish what\'s already-published. Can\'t kill what\'s already dead.') }

Callers 4

publishMethod · 0.95
shouldSaveEntityMethod · 0.80
commitLevelMethod · 0.80
completeFunction · 0.80

Calls 1

getMethod · 0.95

Tested by

no test coverage detected