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

Method hasReadPermission

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

Source from the content-addressed store, hash-verified

449 isGoogleClassroom () { return __guard__(this.get('googleClassroomId'), x => x.length) > 0 }
450
451 hasReadPermission (options) {
452 if (options == null) { options = { showNoty: false } }
453 const showNoty = options.showNoty || false
454 const result = classroomUtils.hasPermission('read', {
455 ownerId: this.get('ownerID'),
456 permissions: this.get('permissions')
457 }) || this.hasWritePermission()
458 if (!result && showNoty) {
459 noty({ text: 'teacher.not_read_permission', type: 'error', timeout: 4000, killer: true })
460 }
461 return result
462 }
463
464 hasWritePermission (options) {
465 if (options == null) { options = { showNoty: false } }

Callers 4

getDisplayPermissionMethod · 0.95
fetchForClassroomMethod · 0.80
constructorMethod · 0.80
fetchClansMethod · 0.80

Calls 2

hasWritePermissionMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected