Dont allow to select a project you have no right to assign
This commit is contained in:
parent
11b7b93cf7
commit
b4967b3703
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue