Skip to content

Commit

Permalink
[enhance] don't apply role if get function is not called with role
Browse files Browse the repository at this point in the history
  • Loading branch information
drunkhacker committed Oct 27, 2017
1 parent 876521a commit ac6a9b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ init = function(target) {
}
if (key !== undefined) {
var attr = target.rawAttributes[key];
if (!attr || !attr.roles || attr.roles && attr.roles[options.role] && attr.roles[options.role].get) {
if (!attr || !attr.roles || attr.roles && (!options.role || (attr.roles[options.role] && attr.roles[options.role].get))) {
return $get.call(this, key, options);
} else {
return undefined;
Expand Down

0 comments on commit ac6a9b4

Please sign in to comment.