node_gallery_get_gallery_list() function should use db_rewrite_sql()

Comments

crea’s picture

I think it's safe to assume that user must have view access to the gallery before being able to move images into it. I can't imagine usecases that work otherwise.
If user doesn't have view access to the gallery, we are disclosing node title which is a bad thing

crea’s picture

Status: Active » Closed (duplicate)

db_rewrite_sql() only checks access for the current user, so we can't use it together with arbitrary $uid which the function takes as an argument. We could use something like node_access() function instead..
Regardless of the solution, I think this function is totally messed up and I think it's good idea to fix it inside single issue, so closing this one.
See #1242854: node_gallery_get_gallery_list() and node_gallery_user_access() are totally messed up to continue