The answer depends on what role permissions you assign to an object.
In the example you gave, if you assign only a role permission for A then all of the members of A and B will be granted the access defined by the role class of A. In other words, only the membership of B is included in the membership of A, the access definitions of B play no role (pun intended).
Conversely, if you assign only a role permission for B then A is irrelevant and the members of B get the access defined by the role class of B.
Finally, if you assign role permissions for both A and B, the direct members of A will get the access defined by A, but the members of B will get the union of the access defined by A and B.
------------------------------
Mike
------------------------------