2020-02-08 03:08:24 +00:00
|
|
|
const AuthUser = require('flitter-auth/model/User')
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Auth user model. This inherits fields and methods from the default
|
|
|
|
* flitter-auth/model/User model, however you can override methods and
|
|
|
|
* properties here as you need.
|
|
|
|
*/
|
|
|
|
class User extends AuthUser {
|
2020-02-08 18:36:42 +00:00
|
|
|
static get services() {
|
|
|
|
return [...super.services, 'models']
|
|
|
|
}
|
|
|
|
|
2020-02-08 03:08:24 +00:00
|
|
|
static get schema() {
|
|
|
|
return {...super.schema, ...{
|
|
|
|
// other schema fields here
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
2020-02-08 18:36:42 +00:00
|
|
|
async get_root_page() {
|
|
|
|
const Page = this.models.get('api:Page')
|
|
|
|
return Page.findOne({OrgUserId: this._id, ParentId: '0'})
|
|
|
|
}
|
|
|
|
|
2020-02-08 03:08:24 +00:00
|
|
|
// Other members and methods here
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = User
|