Sha256: 3069538219defabd89fb1d665518981a7da4516fefe441fa1a6640240ad2c876

Contents?: true

Size: 390 Bytes

Versions: 6

Compression:

Stored size: 390 Bytes

Contents

# frozen_string_literal: true
module Decidim
  module Admin
    # A policy to define all the authorizations regarding a
    # ParticipatoryProcess, to be used with Pundit.
    class DashboardPolicy < ApplicationPolicy
      # Checks if the user can see the admin dashboard.
      #
      # Returns a Boolean.
      def show?
        user.roles.include?("admin")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
decidim-admin-0.0.1.alpha7 app/policies/decidim/admin/dashboard_policy.rb
decidim-0.0.1.alpha7 decidim-admin/app/policies/decidim/admin/dashboard_policy.rb
decidim-admin-0.0.1.alpha6 app/policies/decidim/admin/dashboard_policy.rb
decidim-0.0.1.alpha6 decidim-admin/app/policies/decidim/admin/dashboard_policy.rb
decidim-admin-0.0.1.alpha5 app/policies/decidim/admin/dashboard_policy.rb
decidim-0.0.1.alpha5 decidim-admin/app/policies/decidim/admin/dashboard_policy.rb