Identifiable traces should be trated as private in the trace list.
This commit is contained in:
parent
e8a2a15ea1
commit
9617ca2acc
1 changed files with 4 additions and 4 deletions
|
@ -43,15 +43,15 @@ class TraceController < ApplicationController
|
||||||
# 4 - user's traces, not logged in as that user = all user's public traces
|
# 4 - user's traces, not logged in as that user = all user's public traces
|
||||||
if target_user.nil? # all traces
|
if target_user.nil? # all traces
|
||||||
if @user
|
if @user
|
||||||
conditions = ["(gpx_files.visibility <> 'private' OR gpx_files.user_id = ?)", @user.id] #1
|
conditions = ["(gpx_files.visibility in ('public', 'identifiable') OR gpx_files.user_id = ?)", @user.id] #1
|
||||||
else
|
else
|
||||||
conditions = ["gpx_files.visibility <> 'private'"] #2
|
conditions = ["gpx_files.visibility in ('public', 'identifiable')"] #2
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if @user and @user == target_user
|
if @user and @user == target_user
|
||||||
conditions = ["gpx_files.user_id = ?", @user.id] #3 (check vs user id, so no join + can't pick up non-public traces by changing name)
|
conditions = ["gpx_files.user_id = ?", @user.id] #3 (check vs user id, so no join + can't pick up non-public traces by changing name)
|
||||||
else
|
else
|
||||||
conditions = ["gpx_files.visibility <> 'private' AND gpx_files.user_id = ?", target_user.id] #4
|
conditions = ["gpx_files.visibility in ('public', 'identifiable') AND gpx_files.user_id = ?", target_user.id] #4
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ class TraceController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def georss
|
def georss
|
||||||
conditions = ["gpx_files.visibility <> 'private'"]
|
conditions = ["gpx_files.visibility in ('public', 'identifiable')"]
|
||||||
|
|
||||||
if params[:display_name]
|
if params[:display_name]
|
||||||
conditions[0] += " AND users.display_name = ?"
|
conditions[0] += " AND users.display_name = ?"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue