Sha256: ad690a42e42c808110be5d277a9bf708314ab2635d9802972a5aec210b1f5bd7

Contents?: true

Size: 465 Bytes

Versions: 85

Compression:

Stored size: 465 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Blog
    class Permissions < Decidim::DefaultPermissions
      def permissions
        return permission_action unless permission_action.subject == :blogpost

        if permission_action.scope == :public
          allow!
          return permission_action
        end

        return permission_action if permission_action.scope != :admin

        allow!
        permission_action
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
decidim-blogs-0.20.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.20.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.19.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.18.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.19.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.17.2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.18.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.17.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.16.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.17.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.16.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.15.2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.15.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.15.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.14.4 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.14.3 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.14.2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.14.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.13.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.12.2 app/permissions/decidim/blog/permissions.rb