scopes.rb revision 7f12123144c64e1114c5fc62158230fa96706746
included do
if user
OR id IN (SELECT item_id
FROM permissions
WHERE item_type = 'Repository'
AND subject_type = 'User' AND subject_id = ?)
OR id IN (SELECT item_id
FROM permissions
INNER JOIN team_users
ON team_users.team_id = permissions.subject_id
AND team_users.user_id = ?
WHERE item_type = 'Repository'
else
end
end
# Ready for pulling
end
end
end