Skip to content

Commit

Permalink
Merge pull request #5 from fabrix-app/v1.1
Browse files Browse the repository at this point in the history
[feat] check against events
  • Loading branch information
scott-wyatt authored Sep 5, 2018
2 parents 38b90d6 + 8289ed0 commit 0024602
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 428 deletions.
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
- run:
name: install-npm-wee
command: npm install
- run:
name: install-npm-sqlite
command: npm install [email protected]
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
Expand Down
12 changes: 8 additions & 4 deletions lib/api/services/PermissionsService.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { FabrixService as Service } from '@fabrix/fabrix/dist/common'

export class PermissionsService extends Service {
publish(type, event, options: {save?: boolean, transaction?: any} = {}) {
if (this.app.services.EngineService) {
return this.app.services.EngineService.publish(type, event, options)
publish(type, event, options: {save?: boolean, transaction?: any, include?: any} = {}) {
if (this.app.services.EventsService) {
options.include = options.include || [{
model: this.app.models.EventItem.instance,
as: 'objects'
}]
return this.app.services.EventsService.publish(type, event, options)
}
this.app.log.debug('Spool-engine is not installed, please install it to use publish')
this.app.log.debug('spool-events is not installed, please install it to use publish')
return Promise.resolve()
}

Expand Down
14 changes: 8 additions & 6 deletions lib/api/services/UserCsvService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import { readFileSync } from 'fs'
* @description User CSV Service
*/
export class UserCsvService extends Service {
publish(type, event, options: {save?: boolean, transaction?: any} = {}) {
if (this.app.services.EngineService) {
return this.app.services.EngineService.publish(type, event, options)
}
else {
this.app.log.debug('Spool-engine is not installed, please install it to use publish')
publish(type, event, options: {save?: boolean, transaction?: any, include?: any} = {}) {
if (this.app.services.EventsService) {
options.include = options.include || [{
model: this.app.models.EventItem.instance,
as: 'objects'
}]
return this.app.services.EventsService.publish(type, event, options)
}
this.app.log.debug('spool-events is not installed, please install it to use publish')
return Promise.resolve()
}

Expand Down
6 changes: 5 additions & 1 deletion lib/config/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ export const permissions = {
// The default super admin username
defaultAdminUsername: 'admin',
// The default super admin password
defaultAdminPassword: 'admin1234'
defaultAdminPassword: 'admin1234',
// Send Emails
emails: {},
// Allow Events
events: {}
}
4 changes: 3 additions & 1 deletion lib/schemas/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ export const permissions = joi.object().keys({
permissions: joi.array()
}).required(),
defaultAdminUsername: joi.string().required(),
defaultAdminPassword: joi.string().required()
defaultAdminPassword: joi.string().required(),
emails: joi.object(),
events: joi.object()
})
Loading

0 comments on commit 0024602

Please sign in to comment.