Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1138a97

Browse files
author
Cristian
committed
Decouple security methods from Meteor
1 parent 06a1ec8 commit 1138a97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎imports/api/security.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ export default class Security {
33
return Roles.userIsInRole(userId, ['admin'], 'default-group');
44
}
55

6-
static isUser() {
7-
return Roles.userIsInRole(this.userId, ['user'], 'default-group');
6+
static isUser(userId) {
7+
return Roles.userIsInRole(userId, ['user'], 'default-group');
88
}
99

1010
static checkLoggedIn(userId) {
@@ -14,7 +14,7 @@ export default class Security {
1414
}
1515

1616
static checkLoggedUser(userId) {
17-
if (userId !== this.userId) {
17+
if (userId !== Meteor.userId()) {
1818
throw new Meteor.Error('not-authorized', 'You are not authorized');
1919
}
2020
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /