(options)
| 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() |
no test coverage detected