Comments (5)
released as v0.5.0
from feathers-casl.
Please fork the repo, do the changes to your fork and make a PR with the new test.
Would you please also add a test with:
can("read", "tests", {
$or: [
{ published: true }
{ user_id: { $in: [1] } },
]
});
}
I know Casl
states out, that this is not possible, but I would like to see the outcome.
I see that you're not using rulesToQuery or other helpers that CASL provides for this kind of thing. Is there a reason for that?
As stated on slack before, the following will not work properly withrulesToQuery
:
rule: can('find', 'posts', { id: { $in: [1, 2, 3] } })
query: service('posts').find({ query: { id: { $in: [1, 2] } } } );
Expected:
finds 2 items with ids 1 and 2
Actually:
finds 3 items with ids 1, 2 and 3
from feathers-casl.
The problem with rulesToQuery
is, that not all adapters support $not
, $and
and $nor
(toMongoQuery
).
I've started a new branch: https://github.com/fratzinger/feathers-casl/tree/multiple-adapters to test against most of the popular adapters.
from feathers-casl.
Please have a look at: https://github.com/fratzinger/feathers-casl/tree/logical-or that consequently integrates the $or
logical
from feathers-casl.
I consider this ready now for v0.5.0
but I need some investigations. Stay tuned.
from feathers-casl.
Related Issues (20)
- Documentation Difficulties
- using $exists in casl using createMongoAbility throws error (knex) HOT 1
- Update checkData function to support custom methods
- Feathers casl is not replacing dispatch data (data leak)
- Next version for feathers 5 HOT 3
- Nest JS authorization with CASL doesn't work as expected HOT 1
- You're not allowed to get on 'users' HOT 3
- AbilityBuilder expected 1 arguement, but got 0 HOT 3
- Is the anonymous channel needed anymore? HOT 7
- Remove ability on logout
- remove: No record found for id HOT 5
- Missing resource results in "You are not allowed to get X" message HOT 3
- [Question] Custom adapter HOT 1
- How can we express an ltree condition with feathers-casl? HOT 1
- [email protected] - error with 'feathers-utils' is a CommonJS module HOT 2
- Support for casl v6 ? HOT 2
- Documentation contains non-existent reference to @casl/ability -> makeAbilityFromRules HOT 3
- Documentation section 'add-abilities-to-hooks-context': wrong import file reference
- Ability to have multiple "stages" for permissions?
- find rule with restricted field not working 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 feathers-casl.