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

Method hasCampaignAccess

app/models/User.js:1500–1508  ·  view source on GitHub ↗
(campaignData)

Source from the content-addressed store, hash-verified

1498 // - Teacher
1499 // Update in server/models/User also, if updated here.
1500 hasCampaignAccess (campaignData) {
1501 if (utils.freeCampaignIds.includes(campaignData._id)) { return true }
1502 if (this.isAdmin() || this.isInternal()) { return true }
1503
1504 if (User.isTeacher(this.attributes)) { return true } // TODO revisit this - we may want to restrict unpaid teachers
1505 if (this.isStudent()) { return true } // TODO this should validate the student license, but we currently check this else where
1506
1507 return false
1508 }
1509
1510 // Template for a new experiment.
1511 // getOrStartTemplateExperimentValue () {

Callers

nothing calls this directly

Calls 4

isAdminMethod · 0.95
isInternalMethod · 0.95
isStudentMethod · 0.95
isTeacherMethod · 0.80

Tested by

no test coverage detected