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
Léo-Paul Géneau
gitlab-ce
Commits
31fdcac1
Commit
31fdcac1
authored
May 30, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UserTeam: Fixed bug when impossible to change admin flag after checked
parent
6e5b1686
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
lib/gitlab/user_team_manager.rb
lib/gitlab/user_team_manager.rb
+13
-8
No files found.
lib/gitlab/user_team_manager.rb
View file @
31fdcac1
...
@@ -25,23 +25,28 @@ module Gitlab
...
@@ -25,23 +25,28 @@ module Gitlab
def
update_team_user_membership
(
team
,
member
,
options
)
def
update_team_user_membership
(
team
,
member
,
options
)
updates
=
{}
updates
=
{}
if
options
[
:default_projects_access
]
&&
options
[
:default_projects_access
].
to_s
!=
team
.
default_projects_access
(
member
).
to_s
if
options
[
:default_projects_access
].
present?
updates
[
:permission
]
=
options
[
:default_projects_access
]
default_projects_access
=
options
[
:default_projects_access
].
to_s
if
default_projects_access
!=
team
.
default_projects_access
(
member
).
to_s
updates
[
:permission
]
=
default_projects_access
end
end
end
if
options
[
:group_admin
].
to_s
!=
team
.
admin?
(
member
).
to_s
if
options
[
:group_admin
].
present?
updates
[
:group_admin
]
=
options
[
:group_admin
].
present?
group_admin
=
options
[
:group_admin
].
to_s
==
"1"
?
true
:
false
if
group_admin
!=
team
.
admin?
(
member
)
updates
[
:group_admin
]
=
group_admin
end
end
end
return
true
if
updates
.
blank?
return
true
if
updates
.
blank?
user_team_relationship
=
team
.
user_team_user_relationships
.
find_by_user_id
(
member
)
user_team_relationship
=
team
.
user_team_user_relationships
.
find_by_user_id
(
member
)
return
false
unless
user_team_relationship
.
update_attributes
(
updates
)
return
false
unless
user_team_relationship
.
update_attributes
(
updates
)
if
updates
[
:permission
]
rebuild_project_permissions_to_member
(
team
,
member
)
if
updates
[
:permission
]
rebuild_project_permissions_to_member
(
team
,
member
)
end
true
true
end
end
...
...
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