Sha256: 3b4f4337fe3cf8931b82a4fd3e74eaa2236fd08be4678ba8d747787700c4a635

Contents?: true

Size: 289 Bytes

Versions: 19

Compression:

Stored size: 289 Bytes

Contents

module Storytime
  class MediaPolicy
    attr_reader :user, :media

    def initialize(user, media)
      @user = user
      @media = media
    end

    def index?
      !@user.nil?
    end

    def create?
      @media.user == @user
    end

    def destroy?
      true
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
storytime-2.1.6 app/policies/storytime/media_policy.rb
storytime-2.1.5 app/policies/storytime/media_policy.rb
storytime-2.1.4 app/policies/storytime/media_policy.rb
storytime-2.1.3 app/policies/storytime/media_policy.rb
storytime-2.1.2 app/policies/storytime/media_policy.rb
storytime-2.1.1 app/policies/storytime/media_policy.rb
storytime-2.1.0 app/policies/storytime/media_policy.rb
storytime-2.0.0 app/policies/storytime/media_policy.rb
storytime-1.2.0 app/policies/storytime/media_policy.rb
storytime-1.1.1 app/policies/storytime/media_policy.rb
storytime-1.0.7 app/policies/storytime/media_policy.rb
storytime-1.0.6 app/policies/storytime/media_policy.rb
storytime-1.0.5 app/policies/storytime/media_policy.rb
storytime-1.0.2 app/policies/storytime/media_policy.rb
storytime-1.0.1 app/policies/storytime/media_policy.rb
storytime-1.0.0 app/policies/storytime/media_policy.rb
storytime-0.0.4 app/policies/storytime/media_policy.rb
storytime-0.0.2 app/policies/storytime/media_policy.rb
storytime-0.0.1 app/policies/storytime/media_policy.rb