Class: Decidim::Accountability::Admin::Permissions

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

Instance Method Summary collapse

Instance Method Details

#permissionsObject



7
8
9
10
11
12
13
14
15
16
# File 'app/permissions/decidim/accountability/admin/permissions.rb', line 7

def permissions
  return permission_action if permission_action.scope != :admin

  permission_action.allow! if can_perform_actions_on?(:result, result)
  permission_action.allow! if can_perform_actions_on?(:status, status)
  permission_action.allow! if can_perform_actions_on?(:timeline_entry, timeline_entry)
  permission_action.allow! if can_perform_actions_on?(:import_projects, nil)

  permission_action
end