Sha256: 247f13b1501178bef2c94d850f2b5cf22804428be3d4b2d481496fdedc8c08b0

Contents?: true

Size: 421 Bytes

Versions: 3

Compression:

Stored size: 421 Bytes

Contents

# Let's imagine that loading HelloUser component should not be allowed.
# SecureTabPanel makes a security check on what component is being requested, and returns a different component if
# the check doesn't pass.
class SecureTabPanel < SomeTabPanel
  component :tab do |c|
    super c
    if c.klass == HelloUser # class check
      c.klass = Netzke::Core::Panel
      c.title = 'HelloUser not allowed'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
netzke-workspace-0.10.2 spec/rails_app/app/components/secure_tab_panel.rb
netzke-workspace-0.10.1 spec/rails_app/app/components/secure_tab_panel.rb
netzke-workspace-0.10.0 spec/rails_app/app/components/secure_tab_panel.rb