Refactored resource/privilege/role/user controller