From b4967b3703e1d520dd520f4bb7196ba3ecc302e9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 24 Jan 2013 14:10:17 +0200 Subject: [PATCH] Dont allow to select a project you have no right to assign --- app/controllers/teams/projects_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/teams/projects_controller.rb b/app/controllers/teams/projects_controller.rb index 21ddba86..9e9cd9f5 100644 --- a/app/controllers/teams/projects_controller.rb +++ b/app/controllers/teams/projects_controller.rb @@ -9,9 +9,8 @@ class Teams::ProjectsController < Teams::ApplicationController def new user_team - @avaliable_projects = Project.scoped + @avaliable_projects = current_user.owned_projects.scoped @avaliable_projects = @avaliable_projects.without_team(user_team) if user_team.projects.any? - #@projects.reject!(&:empty_repo?) redirect_to team_projects_path(user_team), notice: "No avalible projects." unless @avaliable_projects.any? end