module ShixunsHelper #显示项目配置菜单 def show_project_memu user if user.allowed_to?(:edit_project, @shixun) result = "edit_project" elsif user.allowed_to?(:manage_members, @shixun) result = "training_task" elsif user.allowed_to?(:manage_versions, @shixun) result = "manage_versions" elsif user.allowed_to?(:manage_repository, @shixun) result = "manage_repository" end result end end