-
Notifications
You must be signed in to change notification settings - Fork 33
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
Permissions #41
Comments
Hello @MicahPotter ! You can use the |
Hey @shinework I have been trying to use the async onRequest(req, res, options?) {
const query = req.query
// Do some stuff to the query
Object.assign(req.query, {
where: {...},
});
console.log(query) // The query has everything I would now expect
// I now want next-crud to continue to do its thing with the manipulated query
return req // Do we just return the req here?
} I am missing something obvious I know, but wondered if you could help with an example? |
To clarify, I was looking for a way to automatically add a filter for certain models. So I am hoping I can update the request The req I have looks something like this: const req = {
baseUrl: "",
originalUrl:
"/api/users?where=%7B%22role%22%3A%7B%22%24eq%22%3A%22ADMIN%22%7D%7D&include=",
params: { "0": "/api/users" },
query: {
where: '{"role":{"$eq":"ADMIN"}}',
include: "",
" nextcrud": ["users"],
},
} Do we need to update both the |
Oh, sorry, looks like this is already being discussed in #44 |
I'm not seeing a way to protect certain crud endpoints. Say a user needs to update their own information, but should not have permission to update another user's info. Is there a built in way to do that?
The text was updated successfully, but these errors were encountered: