lib/authz/helpers/view_helpers.rb
def authz_link_to(name, options = {}, html_options = {}, using: nil, skip_scoping: nil)
        url = url_for(options)
        method = html_options[:method] || html_options['method']
        authorized = authorized_path? url, method: method, using: using, skip_scoping: skip_scoping
        link_to(name, options, html_options) if authorized
      end
# Renders a link if user is authorized or does nothing otherwise
# @param name [String] same as Rails link_to
# @param options [Hash] same as Rails link_to
# @param html_options [Hash] same as Rails link_to
# @param using [Object] instance that will be used to determine authorization
# @param skip_scoping [Boolean] option to skip scoping validation
Renders a link if user is authorized or does nothing otherwise
Renders a link if user is authorized or does nothing otherwise
def authz_link_to(name, options = {}, html_options = {}, using: nil, skip_scoping: nil)
        url = url_for(options)
        method = html_options[:method] || html_options['method']
        authorized = authorized_path? url, method: method, using: using, skip_scoping: skip_scoping
        link_to(name, options, html_options) if authorized
      end
def authz_link_to ( name , options = { } , html_options = { } , using : nil , skip_scoping : nil ) url = url_for ( options ) method = html_options [ :method ] || html_options [ 'method' ] authorized = authorized_path? url , method : method , using : using , skip_scoping : skip_scoping link_to ( name , options , html_options ) if authorized end
Renders a link if user is authorized or does nothing otherwise
Renders a link if user is authorized or does nothing otherwise
name
same as Rails link_to
same as Rails link_to
options
same as Rails link_to
same as Rails link_to
html_options
same as Rails link_to
same as Rails link_to
using
instance that will be used to determine authorization
instance that will be used to determine authorization
skip_scoping
option to skip scoping validation
option to skip scoping validation