https://cerbos.dev logo
#help
Title
# help
r

Roman Levytskyi

07/27/2023, 9:27 AM
Hey guys. We’re having problem with the following use case: We call
isAllowed
/
checkResource
with no ID, since we don’t always need the ID anyway, think before creation we check the
action
alone and also add several
expr
that make use of
attributes
and we receive the following:
Copy code
'invalid CheckResourcesRequest.Resources[0]: embedded message failed validation | caused by: invalid CheckResourcesRequest_ResourceEntry.Resource: embedded message failed validation | caused by: invalid Resource.Id: value length must be at least 1 runes'
a

Alex Olivier (Cerbos)

07/27/2023, 9:37 AM
Hey in this case it is recommended to either generated an ID upfront (that will also be used when creating the record in that db) that way your audit log will match up with actual data or just use an ID such as
new
r

Roman Levytskyi

07/27/2023, 9:40 AM
ok, this is feasible but any plans to make this optional? since id is not always needed, it should not be forced.