Resource permission fix

Put `record.data.canWrite` to write permission (it was using canRead)