Sha256: 25c7d60ed023fda50317ada55af4e3b7f5943be4129da65d9816ca55817f62d2

Contents?: true

Size: 515 Bytes

Versions: 49

Compression:

Stored size: 515 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Comments
    module Abilities
      # Defines the abilities related to comments for a logged in user.
      # Intended to be used with `cancancan`.
      class CurrentUserAbility
        include CanCan::Ability

        attr_reader :user, :context

        def initialize(user, context)
          return unless user

          @user = user
          @context = context

          can :report, Decidim::Comments::Comment
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 2 rubygems

Version Path
decidim-comments-0.11.2 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.11.1 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.11.0.pre1 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.10.1 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.10.0 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.9.3 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.9.2 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.9.1 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.9.0 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.8.4 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.8.3 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.8.2 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.8.1 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.8.0 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.7.4 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.7.3 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.7.2 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.7.1 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.7.0 app/models/decidim/comments/abilities/current_user_ability.rb
decidim-comments-0.6.8 app/models/decidim/comments/abilities/current_user_ability.rb