LPS-40695 Moves where clauses
LPS-40695 Checks if User is <= 0 to remove it from query
LPS-40695 Use the same method
LPS-40695 Fix logic, we should get subfolders only when the rootFolderId != Default