forked from strongloop/loopback
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request strongloop#1301 from strongloop/feature/disable-in…
…clude-access-tokens Upgrade test fixtures to 2.x project layouts
- Loading branch information
Showing
45 changed files
with
495 additions
and
389 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ var loopback = require('../'); | |
var lt = require('loopback-testing'); | ||
var path = require('path'); | ||
var ACCESS_CONTROL_APP = path.join(__dirname, 'fixtures', 'access-control'); | ||
var app = require(path.join(ACCESS_CONTROL_APP, 'app.js')); | ||
var app = require(path.join(ACCESS_CONTROL_APP, 'server/server.js')); | ||
var assert = require('assert'); | ||
var USER = {email: '[email protected]', password: 'test'}; | ||
var CURRENT_USER = {email: '[email protected]', password: 'test'}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
test/fixtures/access-control/common/models/access-token.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "accessToken", | ||
"base": "AccessToken", | ||
"baseUrl": "access-tokens", | ||
"acls": [ | ||
{ | ||
"accessType": "*", | ||
"permission": "DENY", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone" | ||
}, | ||
{ | ||
"permission": "ALLOW", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone", | ||
"property": "create" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "account", | ||
"relations": { | ||
"transactions": { | ||
"model": "transaction", | ||
"type": "hasMany" | ||
}, | ||
"user": { | ||
"model": "user", | ||
"type": "belongsTo", | ||
"foreignKey": "userId" | ||
} | ||
}, | ||
"acls": [ | ||
{ | ||
"accessType": "*", | ||
"permission": "DENY", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone" | ||
}, | ||
{ | ||
"accessType": "*", | ||
"permission": "ALLOW", | ||
"principalType": "ROLE", | ||
"principalId": "$owner" | ||
}, | ||
{ | ||
"permission": "DENY", | ||
"principalType": "ROLE", | ||
"principalId": "$owner", | ||
"property": "deleteById" | ||
}, | ||
{ | ||
"accessType": "*", | ||
"permission": "DENY", | ||
"property": "find", | ||
"principalType": "ROLE", | ||
"principalId": "$dummy" | ||
} | ||
], | ||
"properties": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "alert", | ||
"acls": [ | ||
{ | ||
"accessType": "WRITE", | ||
"permission": "DENY", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone" | ||
} | ||
], | ||
"properties": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "bank", | ||
"relations": { | ||
"users": { | ||
"model": "user", | ||
"type": "hasMany" | ||
}, | ||
"accounts": { | ||
"model": "account", | ||
"type": "hasMany" | ||
} | ||
}, | ||
"acls": [ | ||
{ | ||
"accessType": "*", | ||
"permission": "DENY", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone" | ||
}, | ||
{ | ||
"accessType": "READ", | ||
"permission": "ALLOW", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone" | ||
} | ||
], | ||
"properties": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "email", | ||
"base": "Email", | ||
"acls": [ | ||
{ | ||
"accessType": "*", | ||
"permission": "DENY", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone" | ||
} | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
test/fixtures/access-control/common/models/transaction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "transaction", | ||
"acls": [ | ||
{ | ||
"accessType": "*", | ||
"permission": "DENY", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone" | ||
} | ||
], | ||
"properties": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "user", | ||
"base": "User", | ||
"relations": { | ||
"accessTokens": { | ||
"model": "accessToken", | ||
"type": "hasMany", | ||
"foreignKey": "userId" | ||
}, | ||
"transactions": { | ||
"model": "transaction", | ||
"type": "hasMany" | ||
} | ||
}, | ||
"acls": [ | ||
{ | ||
"accessType": "*", | ||
"permission": "DENY", | ||
"principalType": "ROLE", | ||
"principalId": "$everyone" | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"port": 3000, | ||
"host": "0.0.0.0", | ||
"legacyExplorer": false | ||
} |
2 changes: 0 additions & 2 deletions
2
.../fixtures/access-control/datasources.json → ...es/access-control/server/datasources.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
{ | ||
"db": { | ||
"defaultForType": "db", | ||
"connector": "memory" | ||
}, | ||
"mail": { | ||
"defaultForType": "mail", | ||
"connector": "mail" | ||
} | ||
} |
Oops, something went wrong.