Comments (4)
@bjamba Thanks for raising the question. I actually spent quite some time thinking on the best way to deal with empty objects when I wrote the filter
utility.
What behavior would you see happening for the following example?
Key.filter({ a: {}, b: { foo: 'bar' } }, ['!a', '!b.foo'])
Would you see the result to be {}
or { b: {} }
?
from access-control.
I'm currently seeing the result as { a: {} }
. I think if I were to think about what I would like to see in that instance, I'd think I'd like to see { b: {} }
, since if we're nesting into properties.
I guess to put it another way, the way I imagine the filters could work is so that if you are explicitly filtering out a parent key, it should filter out anything that's a child of it. But if I'm filtering a child key that would effectively render the parent key to be an empty object, we preserve the object.
from access-control.
Hi, circling back on this to ask if there had been any additional thoughts on solving this issue or if there was more clarification on my end that was needed. Thanks!
from access-control.
@bjamba Sorry for not getting back to you earlier. What you are saying makes total sense and I'll provide a fix within 10 days. If you wish to make a PR yourself, that's even better!
from access-control.
Related Issues (20)
- Better way to accept null values HOT 3
- Can't install this from yarn HOT 3
- Extending Roles? HOT 7
- Validate resource in addPermissionToRole
- NPM detected vulnerability HOT 2
- Multiple conditions in one statement HOT 3
- Multiple to Multiple condition HOT 1
- Attach more data besides returnedAttributes to permissions HOT 1
- Dependencies due for update HOT 1
- forAnyValueIfExists should pass if environment doesn't have the key
- Suggestions: Hierarchical Role Based Access Control & more... HOT 3
- PermissionEffect type conflict HOT 5
- Fix vulnerabilities HOT 1
- forAllValuesIfExists doesn't pass for env value `null` HOT 4
- Value Associated with Role? HOT 2
- Would this PR be welcomed here? HOT 1
- lodash version bump? HOT 2
- Probably the cleanest repo i've ever seen. Love the use of emojis :) HOT 1
- No Doc for Persistence Layer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from access-control.