added resource sort
added role inheritance