Answers

It's not possible to change this behavior. Group-level permissions are intended to simplify the administration for common security configurations. If the way users get permissions from multiple groups doesn't work for you, you can remove the
group that has the Deny, and instead apply permissions more granularly to the group members. Managing lots of granular permissions can be tedious, but can be automated along the lines of the security sample here:

"This C# sample code shows how to export security information into the specified file and import security information from the file by using MDS APIs (SecurityPrincipalsGet and SecurityPrincipalsClone). "

Make changes in the formulation of the problem. I am trying to create two groups that control access to a single entity and are assigned to a particular user. The first one has more privileged
than the second. After the appointment of its user, I expect to get rights the first group but because of the higher priority operation deny and overlapping rights I've got rights of the second group.

It's not possible to change this behavior. Group-level permissions are intended to simplify the administration for common security configurations. If the way users get permissions from multiple groups doesn't work for you, you can remove the
group that has the Deny, and instead apply permissions more granularly to the group members. Managing lots of granular permissions can be tedious, but can be automated along the lines of the security sample here:

"This C# sample code shows how to export security information into the specified file and import security information from the file by using MDS APIs (SecurityPrincipalsGet and SecurityPrincipalsClone). "