Security Group: associate several users with a record

Hi, i explain what I would like to do:
I have um custom form and I would like the records of this form to be made accessible only to certain users.
Module A
Record 1 (accessible to users: A, B, C)
Record 2 (accessible to users: A, D, E)
Record 3 (accessible to users: F, G, H)

in a nutshell, I would like to create groups that can be associated with records, so, taking the example above, group1 will contain users A, B, C
group2 will contain users A, D, E
group3 will contain users F, G, H

I tried to follow Suiteā€™s guide, but I was unable to recreate the scenario I described above.
the only thing i have done is to assign that record to a single user via the ā€œassigned toā€ field of the form, this is exactly what i would like to do, but instead of the single user, it should refer to the entire group.
Can anyone tell me how to do this please? Thank you.

Here is the guide for typical group setup with security group. I believe you will need group only option.

Yes, as mentioned above, I tried to follow the guides you posted, but I couldnā€™t do it.
I created the group, associated the users to the group, created the roles, went to my form list and associated with the record selection, a security group ā€œSecurity Suite: Global Assignmentā€ (although I donā€™t know if this works, once selected and started, it does something, but then reverts to the initial settings).
In any case, I exit Admin and enter as a user, I donā€™t see that record.

I hope you have assigned the role to that security group. I donā€™t see any problem if you followed this.

It would work for sure.

Yes, I have assigned the role to the group, surely there is something I am forgetting or making a mistakeā€¦ what I am missing is to assign the group to that record.
If, via the ā€œassign toā€ field, I assign that record to a single user, logging in as that user, the record is seen regularly. I cannot associate the group to that record.

In list view, You will have Security groups: Mass Assign

Select record and assign it to group. You will also have subpanel in detailview too.

Yes, Iā€™ve done that too, but as I said above, when I press the assign button itā€™s as if it doesnā€™t do anything, it refreshes the page and returns the value of ā€œSecurity Suite: global assignmentā€ to the initial value: ā€œGroup: noneā€.

Yes, that behavior is correct as it is a listview, this is for updating records not to shown the value. In detail view of your record, Do you have subpanel of Security group?

Actually there wasnā€™t, I added a many-to-many relationshipā€¦ anyway, yes under that record there is indeed, in the subpanel of the security group, the group I created

I believe you donā€™t need to create custom relationship. by default you will have it.

If you have custom module check vardefs.php
modules/YourModulename/vardefs.php
VardefManager::createVardef(ā€˜modulenameā€™, ā€˜modulenameā€™, array(ā€˜basicā€™,ā€˜assignableā€™,ā€˜security_groupsā€™));
Do you have entry of ā€˜security_groupsā€™ into it.

Exactly as you say, in modules/YourModulename/vardefs.php
the line is perfectly present:
VardefManager::createVardef(ā€˜modulenameā€™, ā€˜modulenameā€™, array(ā€˜basicā€™,ā€˜assignableā€™,ā€˜security_groupsā€™));

OK, I saw that among the existing relationships, the one between my custom module and the security group was already present, so I deleted the one I created and now I see the results.
Two things:

1 - why in my custom module I do not see the subpanel of the security group even though it is present among the relationships? How can I make it visible?

2 - what if I make a mistake and want to change the association to another security group? I have tried reassociating, but nothing happens, I could only change it by entering each individual record.