Commit b4967b3703e1d520dd520f4bb7196ba3ecc302e9
1 parent
11b7b93c
Exists in
master
and in
4 other branches
Dont allow to select a project you have no right to assign
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
app/controllers/teams/projects_controller.rb
@@ -9,9 +9,8 @@ class Teams::ProjectsController < Teams::ApplicationController | @@ -9,9 +9,8 @@ class Teams::ProjectsController < Teams::ApplicationController | ||
9 | 9 | ||
10 | def new | 10 | def new |
11 | user_team | 11 | user_team |
12 | - @avaliable_projects = Project.scoped | 12 | + @avaliable_projects = current_user.owned_projects.scoped |
13 | @avaliable_projects = @avaliable_projects.without_team(user_team) if user_team.projects.any? | 13 | @avaliable_projects = @avaliable_projects.without_team(user_team) if user_team.projects.any? |
14 | - #@projects.reject!(&:empty_repo?) | ||
15 | 14 | ||
16 | redirect_to team_projects_path(user_team), notice: "No avalible projects." unless @avaliable_projects.any? | 15 | redirect_to team_projects_path(user_team), notice: "No avalible projects." unless @avaliable_projects.any? |
17 | end | 16 | end |