| 72 | } |
| 73 | |
| 74 | static initClass () { |
| 75 | this.className = 'User' |
| 76 | this.schema = require('schemas/models/user') |
| 77 | this.prototype.urlRoot = '/db/user' |
| 78 | this.prototype.notyErrors = false |
| 79 | this.PERMISSIONS = { |
| 80 | COCO_ADMIN: 'admin', |
| 81 | SCHOOL_ADMINISTRATOR: 'schoolAdministrator', |
| 82 | ARTISAN: 'artisan', |
| 83 | GOD_MODE: 'godmode', |
| 84 | LICENSOR: 'licensor', |
| 85 | API_CLIENT: 'apiclient', |
| 86 | ONLINE_TEACHER: 'onlineTeacher', |
| 87 | BETA_TESTER: 'betaTester', |
| 88 | PARENT_ADMIN: 'parentAdmin', |
| 89 | NAPERVILLE_ADMIN: 'napervilleAdmin', |
| 90 | } |
| 91 | this.SALES_CALL_ACCESS_LEVEL = 'call-sales' |
| 92 | |
| 93 | a = 5 |
| 94 | b = 100 |
| 95 | c = b |
| 96 | |
| 97 | this.prototype.getHeroPoseImage = co.wrap(function * () { |
| 98 | let left |
| 99 | const heroOriginal = (left = this.get('heroConfig')?.thangType) != null ? left : ThangTypeConstants.heroes.captain |
| 100 | const heroThangType = yield fetchJson(`/db/thang.type/${heroOriginal}/version?project=poseImage`) |
| 101 | return '/file/' + heroThangType.poseImage |
| 102 | }) |
| 103 | |
| 104 | this.prototype.fetchOnlineTeachers = co.wrap(function * (users) { |
| 105 | let url = '/db/user/teachers/online' |
| 106 | if (users != null) { |
| 107 | url += `?teachers=${encodeURIComponent(JSON.stringify(users))}` |
| 108 | } |
| 109 | return yield fetchJson(url) |
| 110 | }) |
| 111 | } |
| 112 | |
| 113 | get (attr, withDefault = false) { |
| 114 | const prop = super.get(attr, withDefault) |