Sha256: 9000c7e566248d36212695f7c021236a7768b46769862ed031edf8e034639822

Contents?: true

Size: 918 Bytes

Versions: 13

Compression:

Stored size: 918 Bytes

Contents

module Spider
    
    module Admin
    
        def self.apps
            @apps ||= Spider::OrderedHash
        end

        def self.register_app(mod, controller, options)
            @apps[mod.short_name] = {
                :module => mod,
                :controller => controller,
                :options => options || {}
            }

            Admin::AdminController.route mod.short_name, controller, :do => lambda{ |app_name|
                @scene.current_app = Spider::Admin.apps[app_name]
            }
        end

        def self.allowed_users
            users = []
            @apps.each do |name, app|
                users += app[:options][:users] if app[:options][:users]
            end
            users += self.base_allowed_users
            users.uniq
        end

        def self.base_allowed_users
            [Spider::Auth::SuperUser]
        end
        
        
    end
    
    
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spiderfw-1.0.1 apps/core/admin/admin.rb
spiderfw-1.0.0 apps/core/admin/admin.rb
spiderfw-0.6.39 apps/core/admin/admin.rb
spiderfw-0.6.38 apps/core/admin/admin.rb
spiderfw-0.6.37 apps/core/admin/admin.rb
spiderfw-0.6.35 apps/core/admin/admin.rb
spiderfw-0.6.34 apps/core/admin/admin.rb
spiderfw-0.6.33 apps/core/admin/admin.rb
spiderfw-0.6.32 apps/core/admin/admin.rb
spiderfw-0.6.31 apps/core/admin/admin.rb
spiderfw-0.6.30 apps/core/admin/admin.rb
spiderfw-0.6.29 apps/core/admin/admin.rb
spiderfw-0.6.28 apps/core/admin/admin.rb