Sha256: de4c90ff9dcacec964e1529a833d50a7d9e67f78bed472f98177a4b6505a9e20

Contents?: true

Size: 497 Bytes

Versions: 11

Compression:

Stored size: 497 Bytes

Contents

class <%= name.singularize.classify%>Ability
  include CanCan::Ability

  def initialize(user)

    if user.present? && user.is_admin?

      can :manage, <%= name.singularize.classify%>
      cannot :create, <%= name.singularize.classify%>
      cannot :update, <%= name.singularize.classify%>
      can :manage, :admin_<%= name.underscore.pluralize %>
      cannot :create, :admin_<%= name.underscore.pluralize %>
      cannot :update, :admin_<%= name.underscore.pluralize %>

    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
alchemy-ajax-form-1.2.1 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-2.1.0 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-2.0.0 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-1.2.0 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-1.1.5 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-1.1.3 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-1.1.2 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-1.1.1 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-1.1.0 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-1.0.1 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt
alchemy-ajax-form-1.0.0 lib/generators/custom_form/templates/app/model/generic_ability.rb.tt