You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I've been using accesscontrol to do filtering of objects based on roles and what attributes they have access to and I came across an issue that seems to track down to the normalize function of notation.
Given I have the following:
// allow access to all except password and password_reset_codeconstglobs=['*','!password','!password_reset_code'];// normalize them (called as part of filter but the issue remains in normalize)constnormalizedGlobs=normalize(globs);// prints out ['*', '!password']console.log(normalizedGlobs);
It seems normalize is stripping out all negated globs that start with another negated attirbute.
So any globs with the same beginning as a previous glob will be 'normalized' out.
Is this intended?
I've tried changing the ordering of the globs in the array and nothing seems to help short of changing the way I structure my data to ensure there is no repeated names.
The text was updated successfully, but these errors were encountered:
So I've been using
accesscontrol
to do filtering of objects based on roles and what attributes they have access to and I came across an issue that seems to track down to thenormalize
function ofnotation
.Given I have the following:
It seems
normalize
is stripping out all negated globs that start with another negated attirbute.It seems to be caused by https://github.com/onury/notation/blob/master/src/core/notation.glob.js#L383 as it does a regex check, in my case, like below:
So any globs with the same beginning as a previous glob will be 'normalized' out.
Is this intended?
I've tried changing the ordering of the globs in the array and nothing seems to help short of changing the way I structure my data to ensure there is no repeated names.
The text was updated successfully, but these errors were encountered: