Sharing data to another user

I’ve been reading about Permissions lately and I’ve found out that I can set permissions on a record/data object level. I’m now planning on implementing a feature that allows users to share their data to other users.
However, I have some concerns regarding this. My application is a Car Management application which allows users to log expenses for each car. So if I wanted to share a car and its data to another user, it means I would have to loop thru all the records and grant access to the user one by one? Or is there a better way to do this?
Currently all objects are accessed by the owner only.

Hi Allen,
There isn’t any better way to set permission on the collection of records.
So you should loop through them.
Regards, Ilya.

I didn’t tried this myself, but wouldn’t using Custom Roles be more efficient?
(This would require “unlimited custom roles” function pack, and maybe “Admin and management api”)
So you would create new custom role for each new car, (and set permissions to that role), and then, when you need share - just add user to this particular custom role.
But again, I didn’t tried it, just thinking out loud.

Hi Ilya,

Thanks for the input. Unfortunately this might not be efficient when records have grown to thousands or more.

Yuriy’s idea is a good one. I’ll look into it.

Thanks to both of you.