Class: Decidim::Abilities::EveryoneAbility

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability
Defined in:
app/models/decidim/abilities/everyone_ability.rb

Overview

Defines the base abilities for any user. Guest users will use these too. Intended to be used with ‘cancancan`.

Instance Method Summary collapse

Constructor Details

#initialize(user, _context) ⇒ EveryoneAbility

Returns a new instance of EveryoneAbility.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/decidim/abilities/everyone_ability.rb', line 10

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