-
Notifications
You must be signed in to change notification settings - Fork 113
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
RolePolicy Cannot set property 'owner' of undefined #227
Comments
That seems to fix it. I wonder how/when this broke down. |
Didn't work for me. It seems to happen because "where" is actually a string and "owner" property is being assigned to literal value. |
addresses error: TypeError: Cannot set property 'owner' of undefined at module.exports (/node_modules/sails-permissions/dist/api/policies/RolePolicy.js:43:34)
If you have come here looking for a solution and you are lazy like me and don't want to fork and npm install etc., copy |
@dottodot The provided fix isn't fixing actually, but simply disabling owner policy. The previous code is actually bad practice as it expects Try this to prove my assumption:
In my case this is logging
Guess it doesn't contain Here comes the full proof:
So, how to fix this? Neither way is correct. Actually sails-permissions has to support such implicit provision of UPDATE: Another option working for now is this:
But this applies only if semantics of req.params won't change in future. A final solution might require approach described before. |
I also stumbled upon this issue, it actually happens for me every time i try to call the /user/me route without being admin (so you are the owner of the resource). So quite a prominent use-case I think ... |
++ |
This doesn't seem to work
where as this does
The text was updated successfully, but these errors were encountered: