Moving some logic out of ResourceRightController.