Sha256: 16c007baa8fc4d5ba2d06190ae8e68f5ed9df483225ecd11b7ce416984c56a39

Contents?: true

Size: 380 Bytes

Versions: 6

Compression:

Stored size: 380 Bytes

Contents

module Orange
  class UserResource < Orange::ModelResource
    use Orange::User
    call_me :users
    def afterLoad
      orange[:admin, true].add_link("Settings", :resource => @my_orange_name, :text => 'Users')
    end
    
    def access_allowed?(packet, user)
      u = model_class.first(:open_id => user)
      return false unless u
      u.allowed?(packet)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
orange-0.0.13 lib/orange/resources/user_resource.rb
orange-0.0.12 lib/orange/resources/user_resource.rb
orange-0.0.10 lib/orange/resources/user_resource.rb
orange-0.0.8 lib/orange/resources/user_resource.rb
orange-0.0.7 lib/orange/resources/user_resource.rb
orange-0.0.6 lib/orange/resources/user_resource.rb