Add system announcements interface
This commit is contained in:
@@ -24,10 +24,6 @@ class ClientModel extends Model {
|
||||
}
|
||||
}
|
||||
|
||||
can(scope) {
|
||||
return this.api_scopes.includes()
|
||||
}
|
||||
|
||||
async application() {
|
||||
const Application = this.models.get('Application')
|
||||
return Application.findOne({ active: true, oauth_client_ids: this.id })
|
||||
|
||||
26
app/models/system/Announcement.model.js
Normal file
26
app/models/system/Announcement.model.js
Normal file
@@ -0,0 +1,26 @@
|
||||
const { Model } = require('flitter-orm')
|
||||
|
||||
class AnnouncementModel extends Model {
|
||||
static get schema() {
|
||||
return {
|
||||
title: String,
|
||||
message: String,
|
||||
user_ids: [String],
|
||||
group_ids: [String],
|
||||
type: String, // login | email | banner
|
||||
}
|
||||
}
|
||||
|
||||
async to_api() {
|
||||
return {
|
||||
id: this.id,
|
||||
title: this.title,
|
||||
message: this.message,
|
||||
user_ids: this.user_ids,
|
||||
group_ids: this.group_ids,
|
||||
type: this.type,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = exports = AnnouncementModel
|
||||
Reference in New Issue
Block a user