-
Notifications
You must be signed in to change notification settings - Fork 79
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
Can't set field-level authorization in amplify gen2 #2786
Comments
Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂 |
Hey @binarycombinatrix, When using field-level authorization, you must grant at least read permissions to the remaining fields. I've noticed that the
|
Hi @AnilMaktala did you try running your version? Those other fields are not required fields and so do not require field level auth, as the model level authorization applies to them and I added publicApi read to it already. The error too says the issue is with required fields. |
I believe there is a bug with the error message. The error message is present when including
I'm not sure why this is causing this error, but you may want to change this anyway. This auth configuration allows any user to modify the comments associated with a video (even videos they do not own). That means any authenticated user could remove comments from a video. I assume you set this auth so that any user could leave a comment on a given video. A more secure way to implement this would be to create a custom mutation (such as https://docs.amplify.aws/react/build-a-backend/data/custom-business-logic/ |
Hey @binarycombinatrix, After further investigation, we found that the comment model has
|
Hey 👋 , This issue is being closed due to inactivity. If you are still experiencing the same problem and need further assistance, please feel free to leave a comment. This will enable us to reopen the issue and provide you with the necessary support. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Environment information
Description
Even after specifying field level authorization for all required fields, it says required fields missing field-level authorization rules: below is the schema file
amplify/data/resource.ts
The error from the terminal is as below:
Failed to instantiate data construct
The text was updated successfully, but these errors were encountered: