Sha256: d60e5e46199e0d024853c61bf966cea99959195f83c3241fa58172a2739b9b4f

Contents?: true

Size: 581 Bytes

Versions: 5

Compression:

Stored size: 581 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Abilities
    # Defines the base abilities for any user. Guest users will use these too.
    # Intended to be used with `cancancan`.
    class Everyone
      include CanCan::Ability

      def initialize(user, _context)
        can :read, ParticipatoryProcessGroup
        can :read, ParticipatoryProcess, &:published?
        can :read, :public_pages
        can :manage, :locales

        can :read, Feature, &:published?

        can :manage, User do |other|
          other == user
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
decidim-core-0.4.0 app/models/decidim/abilities/everyone.rb
decidim-core-0.3.2 app/models/decidim/abilities/everyone.rb
decidim-core-0.3.1 app/models/decidim/abilities/everyone.rb
decidim-core-0.3.0 app/models/decidim/abilities/everyone.rb
decidim-core-0.2.0 app/models/decidim/abilities/everyone.rb