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.1 examples/datacatalog/resources/users.rb
sinatra_resource-0.4.0 examples/datacatalog/resources/users.rb
sinatra_resource-0.3.6 examples/datacatalog/resources/users.rb
sinatra_resource-0.3.5 examples/datacatalog/resources/users.rb
sinatra_resource-0.3.4 examples/datacatalog/resources/users.rb
sinatra_resource-0.3.3 examples/datacatalog/resources/users.rb
sinatra_resource-0.3.2 examples/datacatalog/resources/users.rb