Module: RestfulAclHelper

Defined in:
lib/restful_acl_helper.rb

Instance Method Summary collapse

Instance Method Details

#creatableObject Also known as: createable



7
8
9
10
# File 'lib/restful_acl_helper.rb', line 7

def creatable
  return true if admin_enabled
  klass.is_creatable_by(current_user, parent_obj)
end

#deletable(object) ⇒ Object Also known as: deleteable



23
24
25
26
27
28
# File 'lib/restful_acl_helper.rb', line 23

def deletable(object)
  return true if admin_enabled

  parent = object.get_mom rescue nil
  object.is_deletable_by(current_user, parent)
end

#indexableObject



2
3
4
5
# File 'lib/restful_acl_helper.rb', line 2

def indexable
  return true if admin_enabled
  klass.is_indexable_by(current_user, parent_obj)
end

#readable(object) ⇒ Object



32
33
34
35
36
37
# File 'lib/restful_acl_helper.rb', line 32

def readable(object)
  return true if admin_enabled

  parent = object.get_mom rescue nil
  object.is_readable_by(current_user, parent)
end

#updatable(object) ⇒ Object Also known as: updateable



14
15
16
17
18
19
# File 'lib/restful_acl_helper.rb', line 14

def updatable(object)
  return true if admin_enabled

  parent = object.get_mom rescue nil
  object.is_updatable_by(current_user, parent)
end