-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Extend ACL with Relation Support #1362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
An idea to consider: The remoting metadata already has Perhaps we can add For example, define('__get__' + relationName, {
isStatic: false,
// ...
accessType: 'READ',
accessTarget: relation.modelTo
}); The permission check for
What is not clear: how to deal with writes, does |
Why do we need this? I guess this could be accomplished by calling So to illustrate the check:
Hmm... This makes me think that we should treat these methods as sugar and just apply the ACLs as if they were accessed without a relation. If we do this the
|
During an offline discussion @raymondfeng brought up an interesting alternative. To pass the remote context around the call stack as part of the options param. The implementation of this has several parts. 1. injecting the
|
I'm leaning towards the simpler solution: adding an |
There is one thing I dislike about At the moment, juggler is a standalone library that can be used on its own and I'd like to preserve that, as it is a good design decision IMO. Having said that, I can imagine we can rework this initial proposal to make it more generic and fit better into the standalone juggler. For example, instead of Now it all depends on how much time we are willing to invest into this. Providing the current user in the I am personally fine with both ways. |
Actually, the solution based on In the light of that, I am leaning towards |
There is a problem with I think passing around an The downside is that we are making remote methods potentially less useful when not called remotely. |
What makes this hard to implement is the missing The other tricky part is ensuring we pass the
|
I don't think we would lose this. If you don't pass the |
Keep in mind... what actually might make this worthwhile is laying the ground work for So the problem now is that in order to fix something that otherwise seems like a fairly small issue we have to add a huge feature. :( |
So after much deliberation @bajtos @raymondfeng and I have agreed on adding a new We'll use this hook to implement a relation specific check to ensure the principal has access to all requested models. /customers/1/reviews?include=secrets
Will result in these checkAccess calls:
- Customer.findById(1) => Customer.checkAccess() (from enableAuth())
- Reviews.find({where: ...}) => Reviews.checkAccess()
- Secrets.find() => Secrets.checkAccess() |
@raymondfeng is adding context propagation for passing around transactions. It looks like this can be used to implement his originial suggestion to enhance the access control checking for relations (and include). |
@ritch +1 hope to see this merged soon. Thanks. |
+1 on commit soon |
This looks like a promising solution. What's the status of the implementation these days? |
Hello everyone. I am facing the similar issue on my app. My product is about to go live within 1 month but recently i noticed flaw in ACL leading to access of sensitive data via inclusion. I can't disable include filter because i am fetching alot of data using the inclusion filter along with access token. Can you please give me a workaround or tell me when can i expect the issue to be resolved? |
@ritch and @bajtos - how do users of loopback get insight into when issues are realistically expected to be worked on? No doubt you are all very busy and I understand that PRs are welcome but setting expectations must also be key. Does IBM have any plans to help by beefing up either the dev efforts and/or transparency? |
@mohit1993 You can set |
On Fri 22 Jul, 2016, 9:11 PM Raymond Feng, [email protected] wrote:
But i wanted to use inclusion with access token. Regards |
@raymondfeng Using Would it be possible to add something similar to ACL, but specific to the "include". Whenever nested include is used it would check each models "inclusion" tag and run. This way each model will decides access by role. |
What is the status on this issue??? This should definitely be implemented in next versions... You should no way be able to access a model B without read access just because you have access to model A which is related to model B... This can be easily reproduced at example repo. If you convert all ACLs to a single deny all you should not be able to access anything. However accessing the user/:id with |
here is a workaround which works with one level deep include but not with nested include.
|
@mitsos1os I've just found out this can stop the
|
@caleuanhopkins This indeed complies with security, but it simply disables the feature. The best option would be to have the feature but propagate proper permissions to included models... |
With the release of LoopBack 4.0 GA (see the announcement), this module has entered Active LTS mode and no longer accepts new features (see our LTS policy). |
Uh oh!
There was an error while loading. Please reload this page.
#115 brings up an issue that can only be fixed by extending ACLs with specific support for relations.
In this thread lets discuss the feature and track the work for implementing it.
We should also add example usage of this new feature to the access control example.
@raymondfeng @chandadharap @bajtos
The text was updated successfully, but these errors were encountered: