#✅ - Custom Lambda Auth Gen2 - Revoking Access to All Update Mutations
4 messages · Page 1 of 1 (latest)
If you don't want to allow update mutations, or add custom logic to allow update, you can do it like this:
// amplify/data/resource.ts
...
ExampleModelName: a
.model({
content: a.string().required(),
})
.authorization([
a.allow.public("iam").to(["read", "create", "delete"]) // allows everything except update
a.allow.custom().to(["update"]) // invokes custom lambda logic to determine whether update is allowed
]),
@wide swan This is awesome! Exactly what I wanted. Thank you. I didn't realize you could do two types of authorization! 🎉
✅ - Custom Lambda Auth Gen2 - Revoking Access to All Update Mutations