Sha256: 86d0ed7dbadc947adf2f60cf5399c04fa903ba3b7f5f2c1a4bac4f25277c0673

Contents?: true

Size: 369 Bytes

Versions: 155

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

155 entries across 155 versions & 1 rubygems

Version Path
cm-admin-2.0.1 lib/generators/cm_admin/templates/policy.rb
cm-admin-2.0.0 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.56 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.55 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.54 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.53 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.52 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.51 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.50 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.49 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.48 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.47 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.46 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.45 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.44 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.43 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.42 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.41 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.40 lib/generators/cm_admin/templates/policy.rb
cm-admin-1.5.39 lib/generators/cm_admin/templates/policy.rb