Just push related user organisation to clients.

This commit is contained in:
Martin Edenhofer 2016-05-16 17:03:19 +02:00
parent 8ebe752ee1
commit 7ed7bfb670

View file

@ -5,10 +5,9 @@ class Sessions::Backend::Collections::Organization < Sessions::Backend::Collecti
# get whole collection
all = []
if !@user.role?('Customer')
all = Organization.all
elsif @user.organization_id
all = Organization.where(id: @user.organization_id)
if @user.organization_id
all = Organization.lookup(id: @user.organization_id)
end
all