Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return only one setting when setting_id is given (master) #780

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -58624,11 +58624,15 @@ init_setting_iterator (iterator_t *iterator, const char *uuid,
"SELECT %s"
" FROM settings"
" WHERE uuid = '%s'"
" AND " ACL_GLOBAL_OR_USER_OWNS ()
/* Force the user's setting to come before the default. */
" ORDER BY coalesce (owner, 0) DESC;",
" AND (owner = (SELECT id FROM users WHERE uuid = '%s')"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to not do ACL stuff manually in here, but at least it's consistent with the other branch of the 'if'.

" OR (owner IS NULL"
" AND uuid"
" NOT IN (SELECT uuid FROM settings"
" WHERE owner = (SELECT id FROM users"
" WHERE uuid = '%s'))))",
columns,
quoted_uuid,
current_credentials.uuid,
current_credentials.uuid);
else
init_iterator (iterator,
Expand Down