Restrict edit access to rows in the database table

Hi, I would like to do the following.

  1. Create a "Main Table" with a column for email address.

  2. Restrict edit access such that users can only edit rows of the Main Table that share the same email address as the user.

  3. Additionally, I would also like to restrict edit access on all subtable rows that are linked to the Main Table's appropriate email address.