MCPcopy Create free account
hub / github.com/codecombat/codecombat / hasWritePermission

Method hasWritePermission

app/models/Classroom.js:464–475  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

462 }
463
464 hasWritePermission (options) {
465 if (options == null) { options = { showNoty: false } }
466 const showNoty = options.showNoty || false
467 const result = classroomUtils.hasPermission('write', {
468 ownerId: this.get('ownerID'),
469 permissions: this.get('permissions')
470 })
471 if (!result && showNoty) {
472 noty({ text: $.i18n.t('teacher.not_write_permission'), type: 'error', timeout: 4000, killer: true })
473 }
474 return result
475 }
476
477 isOwner () {
478 return (me.id === this.get('ownerID')) || me.isAdmin()

Callers 15

hasReadPermissionMethod · 0.95
getDisplayPermissionMethod · 0.95
revokeStudentLicensesMethod · 0.95
onClickEditClassroomMethod · 0.80
onClickAddStudentsMethod · 0.80
removeDeletedStudentsMethod · 0.80
enrollStudentsMethod · 0.80
onClickBulkAssignMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected