Module: Lanes::API::Handlers::Screens

Defined in:
lib/lanes/api/handlers/screens.rb

Class Method Summary collapse

Class Method Details

.getObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/lanes/api/handlers/screens.rb', line 8

def self.get
    lambda do
        authentication = Lanes::API::AuthenticationProvider.new(request)
        if authentication.current_user.nil?
            return json_reply std_api_reply :get, {}, success: true
        end
        screens = Lanes::Screen.select do | screen |
            authentication.current_user.can_read?(screen.model)
        end
        # Lanes::Screen.each_group
        json_reply std_api_reply :get, {
                                     screens: screens.map{|s| s.identifier }
                                 }, success: true
    end
end