Sha256: 875fc5b3d8b4fbc69d9b0e925fa6c445a448324c184cf54a81d7574e4b433db5

Contents?: true

Size: 808 Bytes

Versions: 24

Compression:

Stored size: 808 Bytes

Contents

class Admin::SubjectModelAdapter
  attr_accessor :subject_model
  
  def initialize(subject_model)
    @subject_model = subject_model
  end
  
  def guest?
    !subject_model
  end
  
  def logged_in?
    !!subject_model
  end
  
  def owner?(object)
    object && ( object.respond_to?(:author) && ( subject_model == object.author ) ) ||  ( object.respond_to?(:owner) && ( subject_model == object.owner ) )
  end
  alias :own? :owner?
  
  def administrator?
    true
  end
  
  def can?(*args)
    true
  end
  
  def can_edit?(*args)
    true
  end
  
  def can_create?(*args)
    true
  end
  
  def can_destroy?(*args)
    true
  end
  
  def can_new?(*args)
    true
  end
  
  def can_update?(*args)
    true
  end

  def can_sort?(*args)
    true
  end
  
  def can_show?(*args)
    true
  end
  
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fullstack-admin-0.2.26 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.25 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.24 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.23 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.22 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.21 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.20 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.19 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.18 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.17 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.16 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.15 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.14 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.13 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.12 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.11 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.9 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.8 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.7 app/controllers/admin/subject_model_adapter.rb
fullstack-admin-0.2.6 app/controllers/admin/subject_model_adapter.rb