Skip to content

Commit ac6a9b4

Browse files
committed
[enhance] don't apply role if get function is not called with role
1 parent 876521a commit ac6a9b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ init = function(target) {
4848
}
4949
if (key !== undefined) {
5050
var attr = target.rawAttributes[key];
51-
if (!attr || !attr.roles || attr.roles && attr.roles[options.role] && attr.roles[options.role].get) {
51+
if (!attr || !attr.roles || attr.roles && (!options.role || (attr.roles[options.role] && attr.roles[options.role].get))) {
5252
return $get.call(this, key, options);
5353
} else {
5454
return undefined;

0 commit comments

Comments
 (0)