Move role permission check to user function.