Skip to content

Commit

Permalink
Merge branch 'hotfix/2.6.2' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsampaio committed Apr 28, 2020
2 parents 89d7dff + c63f634 commit 95b23b5
Show file tree
Hide file tree
Showing 53 changed files with 23 additions and 1,711 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "account",
"version": "2.6.1",
"version": "2.6.2",
"description": "Microservice responsible for user management and authentication on the OCARIoT platform.",
"main": "dist/server.js",
"scripts": {
Expand Down Expand Up @@ -76,25 +76,25 @@
"@types/body-parser": "^1.19.0",
"@types/chai": "^4.2.11",
"@types/express": "^4.17.6",
"@types/helmet": "^0.0.45",
"@types/helmet": "^0.0.46",
"@types/jsonwebtoken": "^8.3.9",
"@types/mocha": "^7.0.2",
"@types/mongoose": "^5.7.11",
"@types/mongoose": "^5.7.14",
"@types/morgan": "^1.9.0",
"@types/swagger-ui-express": "^4.1.2",
"chai": "^4.2.0",
"gulp": "^4.0.2",
"gulp-nodemon": "^2.5.0",
"gulp-tslint": "^8.1.4",
"gulp-typescript": "^5.0.1",
"mocha": "^7.1.1",
"mocha": "^7.1.2",
"nyc": "^15.0.1",
"sinon": "7.5.0",
"sinon-mongoose": "^2.3.0",
"supertest": "^4.0.2",
"ts-node": "^8.8.2",
"tslint": "^6.1.1",
"typedoc": "^0.17.4",
"ts-node": "^8.9.1",
"tslint": "^6.1.2",
"typedoc": "^0.17.6",
"typescript": "^3.8.3"
}
}
55 changes: 0 additions & 55 deletions src/application/domain/model/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,61 +13,6 @@ export class Admin extends User implements IJSONSerializable, IJSONDeserializabl
constructor(username?: string, password?: string) {
super()
super.type = UserType.ADMIN

super.scopes = [
'users:delete',
'users:resetPassword',
'educators:create',
'educators:read',
'educators:readAll',
'educators:update',
'educators:delete',
'families:create',
'families:read',
'families:readAll',
'families:update',
'families:delete',
'children:create',
'children:read',
'children:readAll',
'children:update',
'children:delete',
'healthprofessionals:create',
'healthprofessionals:read',
'healthprofessionals:readAll',
'healthprofessionals:update',
'healthprofessionals:delete',
'applications:create',
'applications:read',
'applications:readAll',
'applications:update',
'applications:delete',
'institutions:create',
'institutions:read',
'institutions:readAll',
'institutions:update',
'institutions:delete',
'socioquest:read',
'healthquest:read',
'parentphyquest:read',
'childrenphyquest:read',
'habitsquest:read',
'foodhabitsquest:read',
'perceptionquest:read',
'foodtracking:create',
'foodtracking:read',
'foodtracking:update',
'foodtracking:delete',
'physicalactivities:read',
'sleep:read',
'measurements:read',
'environment:read',
'missions:read',
'gamificationprofile:read',
'notifications:create',
'notifications:read',
'notifications:delete'
]
}

public fromJSON(json: any): Admin {
Expand Down
42 changes: 0 additions & 42 deletions src/application/domain/model/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,6 @@ export class Application extends User implements IJSONSerializable, IJSONDeseria
constructor() {
super()
super.type = UserType.APPLICATION
super.scopes = [
'applications:read',
'children:readAll',
'institutions:read',
'institutions:readAll',
'physicalactivities:create',
'physicalactivities:read',
'physicalactivities:update',
'physicalactivities:delete',
'sleep:create',
'sleep:read',
'sleep:update',
'sleep:delete',
'measurements:create',
'measurements:read',
'measurements:delete',
'environment:create',
'environment:read',
'environment:update',
'environment:delete',
'socioquest:read',
'healthquest:read',
'parentphyquest:read',
'childrenphyquest:read',
'habitsquest:read',
'foodhabitsquest:create',
'foodhabitsquest:read',
'perceptionquest:read',
'foodtracking:create',
'foodtracking:read',
'foodtracking:update',
'foodtracking:delete',
'missions:create',
'missions:read',
'missions:update',
'missions:delete',
'gamificationprofile:create',
'gamificationprofile:read',
'gamificationprofile:update',
'gamificationprofile:delete',
'external:sync'
]
}

get application_name(): string | undefined {
Expand Down
22 changes: 0 additions & 22 deletions src/application/domain/model/child.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,6 @@ export class Child extends User implements IJSONSerializable, IJSONDeserializabl
constructor() {
super()
super.type = UserType.CHILD
super.scopes = [
'children:read',
'institutions:read',
'physicalactivities:create',
'physicalactivities:read',
'sleep:create',
'sleep:read',
'measurements:create',
'measurements:read',
'environment:read',
'foodtracking:create',
'foodtracking:read',
'foodtracking:update',
'foodtracking:delete',
'missions:read',
'gamificationprofile:read',
'gamificationprofile:update',
'external:sync',
'notifications:create',
'notifications:read',
'notifications:delete'
]
this.fitbit_status = 'none'
}

Expand Down
50 changes: 0 additions & 50 deletions src/application/domain/model/educator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,6 @@ export class Educator extends User implements IJSONSerializable, IJSONDeserializ
constructor() {
super()
super.type = UserType.EDUCATOR
super.scopes = [
'children:read',
'children:readAll',
'educators:read',
'educators:update',
'childrengroups:create',
'childrengroups:read',
'childrengroups:update',
'childrengroups:delete',
'institutions:read',
'institutions:readAll',
'institutions:update',
'physicalactivities:create',
'physicalactivities:read',
'physicalactivities:update',
'physicalactivities:delete',
'sleep:create',
'sleep:read',
'sleep:update',
'sleep:delete',
'measurements:create',
'measurements:read',
'measurements:delete',
'environment:read',
'childrenphyquest:read',
'habitsquest:create',
'habitsquest:read',
'habitsquest:update',
'foodhabitsquest:create',
'foodhabitsquest:read',
'foodhabitsquest:update',
'perceptionquest:create',
'perceptionquest:read',
'perceptionquest:update',
'foodtracking:create',
'foodtracking:read',
'foodtracking:update',
'foodtracking:delete',
'missions:create',
'missions:read',
'missions:update',
'missions:delete',
'gamificationprofile:create',
'gamificationprofile:read',
'gamificationprofile:update',
'external:sync',
'notifications:create',
'notifications:read',
'notifications:delete'
]
}

get children_groups(): Array<ChildrenGroup> | undefined {
Expand Down
51 changes: 0 additions & 51 deletions src/application/domain/model/family.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,57 +16,6 @@ export class Family extends User implements IJSONSerializable, IJSONDeserializab
constructor() {
super()
super.type = UserType.FAMILY
super.scopes = [
'children:read',
'families:read',
'families:update',
'institutions:read',
'physicalactivities:create',
'physicalactivities:read',
'physicalactivities:update',
'physicalactivities:delete',
'sleep:create',
'sleep:read',
'sleep:update',
'sleep:delete',
'measurements:create',
'measurements:read',
'measurements:delete',
'environment:read',
'socioquest:create',
'socioquest:read',
'socioquest:update',
'healthquest:create',
'healthquest:read',
'healthquest:update',
'parentphyquest:create',
'parentphyquest:read',
'parentphyquest:update',
'childrenphyquest:read',
'habitsquest:create',
'habitsquest:read',
'habitsquest:update',
'foodhabitsquest:create',
'foodhabitsquest:read',
'foodhabitsquest:update',
'perceptionquest:create',
'perceptionquest:read',
'perceptionquest:update',
'foodtracking:create',
'foodtracking:read',
'foodtracking:update',
'foodtracking:delete',
'missions:create',
'missions:read',
'missions:update',
'gamificationprofile:create',
'gamificationprofile:read',
'gamificationprofile:update',
'external:sync',
'notifications:create',
'notifications:read',
'notifications:delete'
]
}

get children(): Array<Child> | undefined {
Expand Down
36 changes: 0 additions & 36 deletions src/application/domain/model/health.professional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,5 @@ export class HealthProfessional extends Educator {
constructor() {
super()
super.type = UserType.HEALTH_PROFESSIONAL
super.scopes = [
'children:read',
'children:readAll',
'healthprofessionals:read',
'healthprofessionals:update',
'childrengroups:create',
'childrengroups:read',
'childrengroups:update',
'childrengroups:delete',
'institutions:read',
'institutions:readAll',
'institutions:update',
'physicalactivities:read',
'sleep:read',
'measurements:read',
'environment:read',
'socioquest:read',
'healthquest:read',
'parentphyquest:read',
'childrenphyquest:create',
'childrenphyquest:read',
'childrenphyquest:update',
'habitsquest:read',
'foodhabitsquest:read',
'perceptionquest:read',
'foodtracking:create',
'foodtracking:read',
'foodtracking:update',
'foodtracking:delete',
'missions:read',
'gamificationprofile:read',
'external:sync',
'notifications:create',
'notifications:read',
'notifications:delete'
]
}
}
9 changes: 0 additions & 9 deletions src/application/domain/model/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export class User extends Entity implements IJSONSerializable, IJSONDeserializab
private _type?: string // Type of user. Can be Child, Educator, Health Professional or Family.
private _institution?: Institution // Institution to which the user belongs.
private _last_login?: Date // Last login time according to the UTC.
private _scopes!: Array<string> // Scope that signal the types of access the user has.

constructor() {
super()
Expand Down Expand Up @@ -62,14 +61,6 @@ export class User extends Entity implements IJSONSerializable, IJSONDeserializab
this._last_login = value
}

get scopes(): Array<string> {
return this._scopes
}

set scopes(value: Array<string>) {
this._scopes = value
}

public fromJSON(json: any): User {
if (!json) return this
if (typeof json === 'string' && JsonUtils.isJsonString(json)) {
Expand Down
Loading

0 comments on commit 95b23b5

Please sign in to comment.