Skip to content

Commit 82cd668

Browse files
committed
fixup! manual fixes
Signed-off-by: Miroslav Bajtoš <[email protected]>
1 parent 397d141 commit 82cd668

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

common/models/acl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ module.exports = function(ACL) {
617617
break;
618618
default:
619619
// try resolving a user model with a name matching the principalType
620-
var userModel = this.registry.findModel(type);
620+
const userModel = this.registry.findModel(type);
621621
if (userModel) {
622622
userModel.findOne(
623623
{where: {or: [{username: id}, {email: id}, {id: id}]}},

common/models/role.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,10 @@ module.exports = function(Role) {
133133
roleModel.roleMappingModel.find({
134134
where: {roleId: context.id, principalType: principalType},
135135
}, function(err, mappings) {
136-
let ids;
137136
if (err) {
138137
return callback(err);
139138
}
140-
ids = mappings.map(function(m) {
139+
const ids = mappings.map(function(m) {
141140
return m.principalId;
142141
});
143142
query.where = query.where || {};

test/access-control.integration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('access control - integration', function() {
137137
return '/api/users/' + this.randomUser.id;
138138
}
139139

140-
let userCounter;
140+
var userCounter; // eslint-disable-line no-var
141141
function newUserData() {
142142
userCounter = userCounter ? ++userCounter : 1;
143143

test/data-source.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('DataSource', function() {
121121
});
122122
});
123123

124-
var assertValidDataSource = function(dataSource) {
124+
function assertValidDataSource(dataSource) {
125125
// has methods
126126
assert.isFunc(dataSource, 'createModel');
127127
assert.isFunc(dataSource, 'discoverModelDefinitions');
@@ -130,7 +130,7 @@ var assertValidDataSource = function(dataSource) {
130130
assert.isFunc(dataSource, 'disableRemote');
131131
assert.isFunc(dataSource, 'defineOperation');
132132
assert.isFunc(dataSource, 'operations');
133-
};
133+
}
134134

135135
assert.isFunc = function(obj, name) {
136136
assert(obj, 'cannot assert function ' + name + ' on object that doesnt exist');

test/role.test.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,13 +1012,12 @@ describe('role model', function() {
10121012
it('should fetch all models assigned to the role', function(done) {
10131013
const principalTypesToModels = {};
10141014
let runs = 0;
1015-
let mappings;
10161015

10171016
principalTypesToModels[RoleMapping.USER] = User;
10181017
principalTypesToModels[RoleMapping.APPLICATION] = Application;
10191018
principalTypesToModels[RoleMapping.ROLE] = Role;
10201019

1021-
mappings = Object.keys(principalTypesToModels);
1020+
const mappings = Object.keys(principalTypesToModels);
10221021

10231022
mappings.forEach(function(principalType) {
10241023
const Model = principalTypesToModels[principalType];
@@ -1047,12 +1046,12 @@ describe('role model', function() {
10471046

10481047
it('should fetch all models only assigned to the role', function(done) {
10491048
const principalTypesToModels = {};
1050-
let mappings;
10511049

10521050
principalTypesToModels[RoleMapping.USER] = User;
10531051
principalTypesToModels[RoleMapping.APPLICATION] = Application;
10541052
principalTypesToModels[RoleMapping.ROLE] = Role;
1055-
mappings = Object.keys(principalTypesToModels);
1053+
1054+
const mappings = Object.keys(principalTypesToModels);
10561055

10571056
async.each(mappings, function(principalType, eachCallback) {
10581057
const Model = principalTypesToModels[principalType];

0 commit comments

Comments
 (0)