Class: Decidim::Consultations::Permissions

Inherits:
DefaultPermissions
  • Object
show all
Defined in:
app/permissions/decidim/consultations/permissions.rb

Instance Method Summary collapse

Instance Method Details

#permissionsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/permissions/decidim/consultations/permissions.rb', line 6

def permissions
  allowed_public_anonymous_action?
  allowed_public_embed_consultation_action?
  allowed_public_embed_question_action?

  return permission_action unless user

  allowed_public_action?

  return Decidim::Consultations::Admin::Permissions.new(user, permission_action, context).permissions if permission_action.scope == :admin

  permission_action
end