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.25.0.rc4 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.25.0.rc3 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.25.0.rc2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.25.0.rc1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.24.3 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.23.6 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.24.2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.23.5 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.24.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.24.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.24.0.rc2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.23.4 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.24.0.rc1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.23.3 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.23.2 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.23.1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.23.1.rc1 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.23.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.22.0 app/permissions/decidim/blog/permissions.rb
decidim-blogs-0.21.0 app/permissions/decidim/blog/permissions.rb