Sha256: 4c7c5b72911c0c8d0e5ce90a22cf42a77db328100619062ed8e01407ebe23c21
Contents?: true
Size: 577 Bytes
Versions: 10
Compression:
Stored size: 577 Bytes
Contents
# frozen_string_literal: true module Decidim module Comments module Abilities # Defines the abilities related to comments for a logged in admin user. # Intended to be used with `cancancan`. class AdminUser include CanCan::Ability attr_reader :user, :context def initialize(user, context) return unless user && user.role?(:admin) @user = user @context = context can :manage, Comment can :unreport, Comment can :hide, Comment end end end end end
Version data entries
10 entries across 10 versions & 2 rubygems