<%= I18n.t(:authorization_rules_graph, :scope => [:declarative_authorization]) %>

<%= I18n.t(:currently_active_rules_in_this_application, :scope => [:declarative_authorization]) %>

<%= navigation %>

<% javascript_tag do %> function update_graph (form) { base_url = "<%= url_for :format => 'svg' %>"; $('graph').data = base_url + '?' + form.serialize(); } function set_filter (filter) { for (f in filter) { var select = $("filter_" + f); if (select) { var opt = select.down("option[value='"+ filter[f] + "']"); if (opt) { opt.selected = true; update_graph(select.form); } } } } <% end %>

<% form_tag do %> <%#= link_to_graph I18n.t(:rules, :scope => [:declarative_authorization]) %> <%#= link_to_graph I18n.t(:privilege_hierarchy, :scope => [:declarative_authorization]), :type => 'priv_hierarchy' %> <%= select_tag "filter_roles", options_for_select([[I18n.t(:all_rules, :scope => [:declarative_authorization]),'']] + controller.authorization_engine.roles.map(&:to_s).sort), :onchange => 'update_graph(this.form)' %> <%= select_tag "filter_contexts", options_for_select([[I18n.t(:all_contexts, :scope => [:declarative_authorization]),'']] + controller.authorization_engine.auth_rules.collect {|ar| ar.contexts.to_a}.flatten.uniq.map(&:to_s).sort), :onchange => 'update_graph(this.form)' %> <%= check_box_tag "effective_role_privs", "1", false, :onclick => 'update_graph(this.form)' %> <%= label_tag "effective_role_privs", I18n.t(:effective_privileges, :scope => [:declarative_authorization]) %> <%= check_box_tag "privilege_hierarchy", "1", false, :onclick => 'update_graph(this.form)' %> <%= label_tag "privilege_hierarchy", I18n.t(:show_full_privilege_hierarchy, :scope => [:declarative_authorization]) %> <% end %>

<%= button_to_function I18n.t(:zoom_in, :scope => [:declarative_authorization]), '$("graph").style.maxWidth = "";$(this).toggle();$(this).next().toggle()' %> <%= button_to_function I18n.t(:zoom_out, :scope => [:declarative_authorization]), '$("graph").style.maxWidth = "100%";$(this).toggle();$(this).previous().toggle()', :style => 'display:none' %>