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
a07be7bc
Commit
a07be7bc
authored
Nov 20, 2015
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed merge conflicts in the User model
parent
1f4dc0b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
20 deletions
+2
-20
app/models/user.rb
app/models/user.rb
+2
-20
No files found.
app/models/user.rb
View file @
a07be7bc
...
...
@@ -422,26 +422,7 @@ class User < ActiveRecord::Base
union
=
Gitlab
::
SQL
::
Union
.
new
([
groups
.
select
(
:id
),
authorized_projects
.
select
(
:namespace_id
)])
<<<<<<<
HEAD
def
authorized_projects_id
@authorized_projects_id
||=
begin
project_ids
=
personal_projects
.
pluck
(
:id
)
project_ids
.
push
(
*
groups_projects
.
pluck
(
:id
))
project_ids
.
push
(
*
projects
.
pluck
(
:id
).
uniq
)
project_ids
.
push
(
*
groups
.
joins
(
:shared_projects
).
pluck
(
:project_id
))
end
end
def
master_or_owner_projects_id
@master_or_owner_projects_id
||=
begin
scope
=
{
access_level:
[
Gitlab
::
Access
::
MASTER
,
Gitlab
::
Access
::
OWNER
]
}
project_ids
=
personal_projects
.
pluck
(
:id
)
project_ids
.
push
(
*
groups_projects
.
where
(
members:
scope
).
pluck
(
:id
))
project_ids
.
push
(
*
projects
.
where
(
members:
scope
).
pluck
(
:id
).
uniq
)
end
=======
Group
.
where
(
"namespaces.id IN (
#{
union
.
to_sql
}
)"
)
>>>>>>>
b6f0eddce552d7423869e9072a7a0706e309dbdf
end
# Returns the groups a user is authorized to access.
...
...
@@ -834,7 +815,8 @@ class User < ActiveRecord::Base
def
projects_union
Gitlab
::
SQL
::
Union
.
new
([
personal_projects
.
select
(
:id
),
groups_projects
.
select
(
:id
),
projects
.
select
(
:id
)])
projects
.
select
(
:id
),
groups
.
joins
(
:shared_projects
).
select
(
:project_id
)])
end
def
ci_projects_union
...
...
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