Sha256: 86d0ed7dbadc947adf2f60cf5399c04fa903ba3b7f5f2c1a4bac4f25277c0673

Contents?: true

Size: 369 Bytes

Versions: 154

Compression:

Stored size: 369 Bytes

Contents

class CmAdmin::<%= class_name %>Policy < ApplicationPolicy
  <%- available_action_names = (@cm_model.available_actions.map{|action| action.name}.uniq - ['custom_action', 'new', 'edit']) %>
  <%- available_action_names.each do |action_name| %>
  def <%= action_name %>?
    <%= CmAdmin.authorized_roles.map {|role| "@user.#{role}" }.join(' && ') %>
  end
  <% end %>
end

Version data entries

154 entries across 154 versions & 1 rubygems

Version Path
cm-admin-4.0.0 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.16 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.15 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.14 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.13 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.12 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.11 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.10 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.9 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.8 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.7 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.6 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.5 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.4 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.3 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.2 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.1 lib/generators/cm_admin/templates/policy.rb
cm-admin-3.0.0 lib/generators/cm_admin/templates/policy.rb
cm-admin-2.4.6 lib/generators/cm_admin/templates/policy.rb
cm-admin-2.4.5 lib/generators/cm_admin/templates/policy.rb