Check/uncheck & save radio button in dynamic table until the last row of table

Dear Fellas,

I need to verify check and uncheck all of the radio buttons in the Dynamic table data grid as shown below:

Test Case:

1-Edit any Roles record
2-Check/uncheck permissions (radio button)
3-Save/Update the Role
4-Repeat steps 1,2,3 for all the permissions (radio buttons) in the Table grid. (image above)

Kindly share a proper solution, thanks a million in advance.