Check against security group rules in all groups while checking for quota

Change-Id: If654d928dfecdbc4ab3464777cb9e4cba17b7333
Closes-Bug: 1365463
(cherry picked from commit 0b0f714273e9134b98aabc499a55b639a67023d9)