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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
e382c8df
Commit
e382c8df
authored
Jun 26, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
team member and hook strong params
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
f86afb73
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
app/controllers/projects/hooks_controller.rb
app/controllers/projects/hooks_controller.rb
+5
-1
app/controllers/projects/team_members_controller.rb
app/controllers/projects/team_members_controller.rb
+5
-1
app/models/users_project.rb
app/models/users_project.rb
+0
-2
app/models/web_hook.rb
app/models/web_hook.rb
+0
-2
No files found.
app/controllers/projects/hooks_controller.rb
View file @
e382c8df
...
@@ -12,7 +12,7 @@ class Projects::HooksController < Projects::ApplicationController
...
@@ -12,7 +12,7 @@ class Projects::HooksController < Projects::ApplicationController
end
end
def
create
def
create
@hook
=
@project
.
hooks
.
new
(
params
[
:hook
]
)
@hook
=
@project
.
hooks
.
new
(
hook_params
)
@hook
.
save
@hook
.
save
if
@hook
.
valid?
if
@hook
.
valid?
...
@@ -40,4 +40,8 @@ class Projects::HooksController < Projects::ApplicationController
...
@@ -40,4 +40,8 @@ class Projects::HooksController < Projects::ApplicationController
def
hook
def
hook
@hook
||=
@project
.
hooks
.
find
(
params
[
:id
])
@hook
||=
@project
.
hooks
.
find
(
params
[
:id
])
end
end
def
hook_params
params
.
require
(
:hook
).
permit
(
:url
)
end
end
end
app/controllers/projects/team_members_controller.rb
View file @
e382c8df
...
@@ -27,7 +27,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
...
@@ -27,7 +27,7 @@ class Projects::TeamMembersController < Projects::ApplicationController
def
update
def
update
@user_project_relation
=
project
.
users_projects
.
find_by
(
user_id:
member
)
@user_project_relation
=
project
.
users_projects
.
find_by
(
user_id:
member
)
@user_project_relation
.
update_attributes
(
params
[
:team_member
]
)
@user_project_relation
.
update_attributes
(
member_params
)
unless
@user_project_relation
.
valid?
unless
@user_project_relation
.
valid?
flash
[
:alert
]
=
"User should have at least one role"
flash
[
:alert
]
=
"User should have at least one role"
...
@@ -67,4 +67,8 @@ class Projects::TeamMembersController < Projects::ApplicationController
...
@@ -67,4 +67,8 @@ class Projects::TeamMembersController < Projects::ApplicationController
def
member
def
member
@member
||=
User
.
find_by
(
username:
params
[
:id
])
@member
||=
User
.
find_by
(
username:
params
[
:id
])
end
end
def
member_params
params
.
require
(
:team_member
).
permit
(
:user_id
,
:project_access
)
end
end
end
app/models/users_project.rb
View file @
e382c8df
...
@@ -16,8 +16,6 @@ class UsersProject < ActiveRecord::Base
...
@@ -16,8 +16,6 @@ class UsersProject < ActiveRecord::Base
include
Notifiable
include
Notifiable
include
Gitlab
::
Access
include
Gitlab
::
Access
#attr_accessible :user, :user_id, :project_access
belongs_to
:user
belongs_to
:user
belongs_to
:project
belongs_to
:project
...
...
app/models/web_hook.rb
View file @
e382c8df
...
@@ -22,8 +22,6 @@ class WebHook < ActiveRecord::Base
...
@@ -22,8 +22,6 @@ class WebHook < ActiveRecord::Base
default_value_for
:issues_events
,
false
default_value_for
:issues_events
,
false
default_value_for
:merge_requests_events
,
false
default_value_for
:merge_requests_events
,
false
#attr_accessible :url
# HTTParty timeout
# HTTParty timeout
default_timeout
10
default_timeout
10
...
...
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