ok you mean move this function to the user model

and let the helper function is_deputy? which is in the same file use the model function with the current_user?