Defect #34029 » 0001-Include-GroupNonMember-and-GroupAnonymous-roles-3402.patch
app/models/user.rb | ||
---|---|---|
610 | 610 |
Role.joins(members: :project). |
611 | 611 |
where(["#{Project.table_name}.status <> ?", Project::STATUS_ARCHIVED]). |
612 | 612 |
where(Member.arel_table[:user_id].eq(id)).distinct |
613 | ||
614 |
if @roles.blank? |
|
615 |
group_class = anonymous? ? GroupAnonymous : GroupNonMember |
|
616 |
@roles = Role.joins(members: :project). |
|
617 |
where(["#{Project.table_name}.status <> ? AND #{Project.table_name}.is_public = ?", Project::STATUS_ARCHIVED, true]). |
|
618 |
where(Member.arel_table[:user_id].eq(group_class.first.id)).distinct |
|
619 |
end |
|
620 | ||
621 |
@roles |
|
613 | 622 |
end |
614 | 623 | |
615 | 624 |
# Returns the user's bult-in role |
- « Previous
- 1
- 2
- 3
- Next »