-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
disableRemoteMethod does not recognize method aliases #1936
Comments
They are alias, you can use any. Though it's not mentioned anywhere... |
I disagree, when writing ACL I believe they're not, 'destroyById' does not resolve anything. Also what is the motivation for having an alias ? it's rather confusing. |
@Overdrivr : Hi, as @alFReD-NSH mentioned, For the ACL, I'm checking if and where consistency is required! Thank you. |
@bajtos : Could you PTAL! |
I am confused, what is the problem you are trying to address here? Can somebody please provide a code snippet showing what you are trying to achieve, explain what was the (unexpected) actual result and what you would like to see instead? |
A failing unit-test would be even better. |
@bajtos ok, I will try to make the failing unit-test. keep you posted |
@bajtos I have worked on this issue. I made a repo https://github.com/Overdrivr/loopback-consistency-test for performing e2e tests. During testing, I found something that I believe does not agree with documentation, that prevents me to test the actual issue in this ticket. If I create two models foo_deleteById and bar.
Then a relation At this point, using an authenticated user, I can create a related model using a related method See the test : https://github.com/Overdrivr/loopback-consistency-test/blob/master/test/test-delete.js#L49 I will check again all the tests and setup, but I cannot find why this test is passing. Or maybe documentation is wrong on this point ? Hope this helps and makes sense |
@raymondfeng @ritch you are much more familiar with ACLs than I am. Could you please help here? |
Any updates ? I can confirm that I am seeing inconsistencies for hiding methods. For instance, in a model script
Do not hide the method. Only deleteById does work
|
@Overdrivr : I believe here that the method aliases are not identified from the list of methods to disable it. |
This should be a relatively easy fix in strong-remoting, we need to fix Are there any volunteers willing to contribute this bug fix? |
Sounds easy enough, I can tackle this issue. I'll make a PR then |
Fixed via strongloop/strong-remoting#385 |
I am still facing this issue with latest version of loopback and strong-remoting (
I will try to make a failing test here in this repository. |
The issue remains on related models, this works:
while this doesnt:
|
I think this is the same issue that was fixed in 3.x versions by #3565:
Unfortunately the backport of #3565 is not trivial because the codebases have diverged and we don't have enough bandwidth to spend more time on this. @Overdrivr could you perhaps take a look at #3565, extract the bits that are relevant to 2.x and open a new pull request to fix the problem you are experiencing? |
@bajtos I'm facing the issue with all my models and relations defined in So I'm not sure this is the problem here. Does this makes sense to you and is it correct ? |
@Overdrivr Your description makes sense to me, but I cannot tell whether your issue is or is not different from what #3565 fixed. I am afraid I don't bandwidth to investigate this problem myself. You can try to upgrade your app to LoopBack 3.x to see if the problem goes away, or you can debug through the code to build a better understanding yourself. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
Could you please clarify why in ACL definition,
deleteById
is used versus in the API it isdestroyById
?It is rather confusing when defining acls for this specific method, people (understand: me, probably others) will try to use
destroyById
because of this documentation while the correct keyword isdeleteById
. Documentation even mentionsremoveById
.Is it planned to have more consistency on the topic ?
The text was updated successfully, but these errors were encountered: