Module: Netzke::Grid::Permissions

Included in:
Base, Tree::Base
Defined in:
lib/netzke/grid/permissions.rb

Instance Method Summary collapse

Instance Method Details

#allowed_to?(action) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
# File 'lib/netzke/grid/permissions.rb', line 4

def allowed_to?(action)
  return allowed_to_read? if action == :read
  permissions[action].nil? ? !config.read_only : permissions[action]
end

#allowed_to_read?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/netzke/grid/permissions.rb', line 9

def allowed_to_read?
  permissions[:read] != false
end

#permissionsObject



13
14
15
# File 'lib/netzke/grid/permissions.rb', line 13

def permissions
  config.permissions || {}
end