Sha256: ebf377b1b3b71df9d646bce9c7d8f6c1973bfff86e86f74186a9119a7c7cac5c

Contents?: true

Size: 612 Bytes

Versions: 27

Compression:

Stored size: 612 Bytes

Contents

module DataCatalog

  class Users < Base
    include Resource

    model User

    # == Permissions

    roles Roles
    permission :list   => :basic
    permission :read   => :basic
    permission :create => :admin
    permission :update => :owner
    permission :delete => :owner

    # == Properties
  
    property :name,       :r => :basic
    property :email,      :r => :owner
    property :role,       :r => :owner, :w => :admin
    property :_api_key,   :r => :owner, :w => :admin
    
    property :token, :r => :owner do |user|
      user.token
    end

    # == Callbacks
  end
  
  Users.build

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
sinatra_resource-0.4.21 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.20 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.19 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.18 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.17 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.16 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.15 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.14 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.13 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.12 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.11 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.10 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.9 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.8 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.7 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.6 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.5 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.4 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.3 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.2 examples/datacatalog/resources/users.rb