Added get rules by resources method to help optimize db queries