ABAC Write Lambda Function Not Working

I’m trying to ensure that the logged-in user/Identity() can edit their own User document (using a custom role), but with limitations on the properties they can edit.
I can’t even get the first part to work (letting them edit their own document). Here is my Lambda function for writing to the Users collection:

Lambda(
  ["oldData", "newData"], 
  Equals(
    Identity(),
    Var("oldData")
  )
)

I’ve tried many variations of the functions (e.g. using Get() around oldData or Identity()).
Any help with getting this to work would be greatly appreciated.
Thanks in advance! :smile:

Try this:

Lambda(
  ["oldData", "newData", "ref"], 
  Equals(
    Identity(),
    Var("ref")
  )
)
1 Like

This worked perfectly. Thanks!

I had this exact same problem, but couldn’t find anything in the docs about the third “ref” argument?