diff --git a/app/repositories/orient_db/collection_repository.rb b/app/repositories/orient_db/collection_repository.rb index c649a4e5e7edddf1c1367038fd586970b0af05b0..1ca088d6817f248d7cc0f7575f1c47ee0e028d52 100644 --- a/app/repositories/orient_db/collection_repository.rb +++ b/app/repositories/orient_db/collection_repository.rb @@ -45,8 +45,11 @@ module OrientDb destroy_edge "BelongsTo", object.id, object.owner.rid end - def all(user) - query = sprintf("select * from (select expand(in('BelongsTo')) from %s) where name<>'Bookmarks'", user.rid) + ## + # Select all collections in context + def all(context = Collections::PublicContext.new) + #query = sprintf("select * from (select expand(in('BelongsTo')) from %s) where name<>'Bookmarks' and privacy = '%s'", user.rid) + query = sprintf("select * from %s where name<>'Bookmarks' and privacy = '%s'", context.from, context.privacy) build_objects connection.query(query) end