module Txtblx::AbilityMixin

Public Instance Methods

txtblx_editor_abilities(user) click to toggle source
# File lib/txtblx/ability_mixin.rb, line 10
def txtblx_editor_abilities(user)
  return if user.nil?

  can(:read, Textblock)
  can(:update, Textblock)
end
txtblx_full_abilities(user) click to toggle source

Call this in the ability initializer of the host app

# File lib/txtblx/ability_mixin.rb, line 4
def txtblx_full_abilities(user)
  return if user.nil?

  can(:manage, Textblock)
end