Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7403afea
Commit
7403afea
authored
Jan 24, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reject non-owned projects to assign to teams
parent
b4967b37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
app/controllers/teams/projects_controller.rb
app/controllers/teams/projects_controller.rb
+12
-6
No files found.
app/controllers/teams/projects_controller.rb
View file @
7403afea
...
@@ -16,13 +16,19 @@ class Teams::ProjectsController < Teams::ApplicationController
...
@@ -16,13 +16,19 @@ class Teams::ProjectsController < Teams::ApplicationController
end
end
def
create
def
create
unless
params
[
:project_ids
].
blank?
redirect_to
:back
if
params
[
:project_ids
].
blank?
project_ids
=
params
[
:project_ids
]
access
=
params
[
:greatest_project_access
]
project_ids
=
params
[
:project_ids
]
user_team
.
assign_to_projects
(
project_ids
,
access
)
access
=
params
[
:greatest_project_access
]
end
# Reject non-allowed projects
allowed_project_ids
=
current_user
.
owned_projects
.
map
(
&
:id
)
project_ids
.
select!
{
|
id
|
allowed_project_ids
.
include?
(
id
)
}
# Assign projects to team
user_team
.
assign_to_projects
(
project_ids
,
access
)
redirect_to
team_projects_path
(
user_team
),
notice:
'Team of users was successfully assgned to projects.'
redirect_to
team_projects_path
(
user_team
),
notice:
'Team of users was successfully ass
i
gned to projects.'
end
end
def
edit
def
edit
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment