Sha256: 722d4870bd127ac58908a5af5c09b588c7261565890b6e15b77f56e121a36ee7

Contents?: true

Size: 562 Bytes

Versions: 13

Compression:

Stored size: 562 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 != :questionnaire

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

          permission_action
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-surveys-0.22.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.21.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.20.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.20.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.19.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.18.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.19.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.17.2 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.18.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.17.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.16.1 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.17.0 app/permissions/decidim/surveys/admin/permissions.rb
decidim-surveys-0.16.0 app/permissions/decidim/surveys/admin/permissions.rb