Class: Decidim::Assemblies::Abilities::Admin::AssemblyCollaboratorAbility

Inherits:
AssemblyRoleAbility
  • Object
show all
Defined in:
app/models/decidim/assemblies/abilities/admin/assembly_collaborator_ability.rb

Overview

Defines the abilities for an assembly collaborator user. Intended to be used with ‘cancancan`.

Instance Method Summary collapse

Methods inherited from AssemblyRoleAbility

#assemblies_with_role_privileges, #can_manage_assembly?, #current_assembly, #define_assembly_abilities, #has_manageable_assemblies?, #initialize, #not_admin?

Constructor Details

This class inherits a constructor from Decidim::Assemblies::Abilities::Admin::AssemblyRoleAbility

Instance Method Details

#define_abilitiesObject



10
11
12
13
14
15
16
# File 'app/models/decidim/assemblies/abilities/admin/assembly_collaborator_ability.rb', line 10

def define_abilities
  super

  can [:read, :preview], Assembly do |assembly|
    can_manage_assembly?(assembly)
  end
end

#roleObject



18
19
20
# File 'app/models/decidim/assemblies/abilities/admin/assembly_collaborator_ability.rb', line 18

def role
  :collaborator
end