Class: Marty::Tree
- Inherits:
-
Netzke::Tree::Base
- Object
- Netzke::Tree::Base
- Marty::Tree
show all
- Extended by:
- Permissions
- Defined in:
- app/components/marty/tree.rb
Constant Summary
Constants included
from Permissions
Permissions::NETZKE_ENDPOINTS
Instance Method Summary
collapse
can_call_endpoint?, can_perform_action?, can_perform_actions, current_user_roles, extended, has_any_perm?, has_marty_permissions, has_perm?
Constructor Details
#initialize(args, kwargs = nil) ⇒ Tree
parent tree is the tree in which child/linked_components is defined child components are components dependent on the selected parent row linked components will update whenever the parent is updated
9
10
11
12
13
|
# File 'app/components/marty/tree.rb', line 9
def initialize args, kwargs = nil
super(args, kwargs)
client_config[:child_components] = child_components || []
client_config[:linked_components] = linked_components || []
end
|
Instance Method Details
#child_components ⇒ Object
36
37
38
|
# File 'app/components/marty/tree.rb', line 36
def child_components
[]
end
|
#class_can?(op) ⇒ Boolean
21
22
23
|
# File 'app/components/marty/tree.rb', line 21
def class_can?(op)
self.class.can_perform_action?(op)
end
|
25
26
27
28
29
30
31
32
33
34
|
# File 'app/components/marty/tree.rb', line 25
def configure(c)
super
c.permissions = {
create: class_can?(:create),
read: class_can?(:read),
update: class_can?(:update),
delete: class_can?(:delete)
}
end
|
44
45
46
47
48
49
50
51
52
53
54
|
# File 'app/components/marty/tree.rb', line 44
def configure_form_window(c)
super
c.klass = Marty::RecordFormWindow
c.width = 475
end
|
#linked_components ⇒ Object
40
41
42
|
# File 'app/components/marty/tree.rb', line 40
def linked_components
[]
end
|