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.29.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.28.4 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.27.9 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.29.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.28.3 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.27.8 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.29.0.rc4 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.29.0.rc3 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.29.0.rc2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.29.0.rc1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.28.2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.27.7 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.28.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.27.6 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.26.10 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.26.9 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.28.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.27.5 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.28.0.rc5 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.28.0.rc4 app/permissions/decidim/blog/permissions.rb