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
Boxiang Sun
gitlab-ce
Commits
6e5b1686
Commit
6e5b1686
authored
May 30, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TeamManagement: Dont update permissions if it was not changed
parent
e14718fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
14 deletions
+12
-14
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+1
-1
lib/gitlab/user_team_manager.rb
lib/gitlab/user_team_manager.rb
+11
-13
No files found.
app/controllers/dashboard_controller.rb
View file @
6e5b1686
...
...
@@ -68,7 +68,7 @@ class DashboardController < ApplicationController
end
def
event_filter
filters
=
cookies
[
'event_filter'
].
split
(
','
)
if
cookies
[
'event_filter'
]
filters
=
cookies
[
'event_filter'
].
split
(
','
)
if
cookies
[
'event_filter'
]
.
present?
@event_filter
||=
EventFilter
.
new
(
filters
)
end
end
lib/gitlab/user_team_manager.rb
View file @
6e5b1686
...
...
@@ -25,7 +25,7 @@ module Gitlab
def
update_team_user_membership
(
team
,
member
,
options
)
updates
=
{}
if
options
[
:default_projects_access
]
&&
options
[
:default_projects_access
]
!=
team
.
default_projects_access
(
member
)
if
options
[
:default_projects_access
]
&&
options
[
:default_projects_access
]
.
to_s
!=
team
.
default_projects_access
(
member
).
to_s
updates
[
:permission
]
=
options
[
:default_projects_access
]
end
...
...
@@ -33,19 +33,17 @@ module Gitlab
updates
[
:group_admin
]
=
options
[
:group_admin
].
present?
end
unless
updates
.
blank?
user_team_relationship
=
team
.
user_team_user_relationships
.
find_by_user_id
(
member
)
if
user_team_relationship
.
update_attributes
(
updates
)
if
updates
[
:permission
]
rebuild_project_permissions_to_member
(
team
,
member
)
end
true
else
false
end
else
true
return
true
if
updates
.
blank?
user_team_relationship
=
team
.
user_team_user_relationships
.
find_by_user_id
(
member
)
return
false
unless
user_team_relationship
.
update_attributes
(
updates
)
if
updates
[
:permission
]
rebuild_project_permissions_to_member
(
team
,
member
)
end
true
end
def
update_project_greates_access
(
team
,
project
,
permission
)
...
...
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