diff --git a/lib/orbit_core_lib.rb b/lib/orbit_core_lib.rb index a6c19f5ed..d050390d0 100644 --- a/lib/orbit_core_lib.rb +++ b/lib/orbit_core_lib.rb @@ -79,9 +79,10 @@ module OrbitCoreLib else auth_object_space = ObjectAuth.where(obj_authable_type: self.to_s,title: title) end - query1 = auth_object_space.any_in({sub_role_ids: sub_role_ids_ary}).excludes(blocked_user_ids: user.id) - query2 = auth_object_space.any_of({all: true},{privilege_user_ids: user.id},{role_ids: user.role_ids}).excludes(blocked_user_ids: user.id) + query2 = auth_object_space.any_of({all: true},{privilege_user_ids: user.id}).excludes(blocked_user_ids: user.id) + # query2 = auth_object_space.any_of({all: true},{privilege_user_ids: user.id},{role_ids: user.role_ids}).excludes(blocked_user_ids: user.id) #save for backup if something went wrong (0626 Matt) + result = (query1 + query2).uniq result.collect{|t| t.obj_authable}.delete_if{|val| val==nil} end