Sha256: 2fd5d537bb2c58352fd82e1b8796724d7febd73e3762a8e983c9cca16ce8eaad

Contents?: true

Size: 555 Bytes

Versions: 14

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Surveys
    module Admin
      class Permissions < Decidim::DefaultPermissions
        def permissions
          return permission_action unless user

          return permission_action if permission_action.scope != :admin

          return permission_action if permission_action.subject != :survey

          case permission_action.action
          when :export_answers, :update
            permission_action.allow!
          end

          permission_action
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
decidim-surveys-0.15.2 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.15.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.15.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.14.4 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.14.3 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.14.2 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.14.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.13.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.12.2 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.13.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.12.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.13.0.pre1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.12.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.12.0.pre app/permissions/decidim/surveys/admin/permissions.rb