Sha256: 024dfde9b6c2c86e9da21772671382f55ec7d9a279c4c0189c689313ed17f689

Contents?: true

Size: 1.81 KB

Versions: 6

Compression:

Stored size: 1.81 KB

Contents

<h1>Authorization Usage</h1>
<%= render 'authorization_rules/show_graph' %>
<p>Filter rules in actions by controller:</p>
<p><%= navigation %></p>
<style type="text/css">
  .auth-usages th { text-align: left; padding-top: 1em }
  .auth-usages td { padding-right: 1em }
  .auth-usages tr.action  { cursor: pointer }
  .auth-usages tr.unprotected  { background: #FFA399 }
  .auth-usages tr.no-attribute-check { background: #FFE599 }
  /*.auth-usages tr.catch-all td.privilege,*/
  .auth-usages tr.default-privilege td.privilege,
  .auth-usages tr.default-context td.context { color: #888888 }
  #graph-container {margin: 1em; border:1px solid #ccc; max-width:50%; position:fixed; right:0;}
</style>
<table class="auth-usages">
  <% @auth_usages_by_controller.keys.sort {|c1, c2| c1.name <=> c2.name}.each do |controller| %>
    <% default_context = controller.controller_name.to_sym rescue nil %>
    <tr>
      <th colspan="3"><%= h controller.name.underscore.sub(/_controller\Z/, '') %></th>
    </tr>
    <% @auth_usages_by_controller[controller].keys.sort {|c1, c2| c1.to_s <=> c2.to_s}.each do |action| %>
      <% auth_info = @auth_usages_by_controller[controller][action] %>
      <% first_permission = auth_info[:controller_permissions] && auth_info[:controller_permissions][0] %>
      <tr class="action <%= auth_usage_info_classes(auth_info) %>" title="<%= auth_usage_info_title(auth_info) %>" onclick="show_graph('<%= auth_info[:privilege] || action %>','<%= auth_info[:context] || default_context %>')">
        <td><%= h action %></td>
        <% if first_permission %>
          <td class="privilege"><%= h auth_info[:privilege] || action %></td>
          <td class="context"><%= h auth_info[:context] || default_context %></td>
        <% else %>
          <td></td><td></td>
        <% end %>
      </tr>
    <% end %>
  <% end %>
</table>

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
zeiv-declarative_authorization-1.0.0.pre app/views/authorization_usages/index.html.erb
declarative_authorization-0.5.7 app/views/authorization_usages/index.html.erb
declarative_authorization-0.5.6 app/views/authorization_usages/index.html.erb
declarative_authorization-0.5.5 app/views/authorization_usages/index.html.erb
declarative_authorization-0.5.4 app/views/authorization_usages/index.html.erb
declarative_authorization-0.5.3 app/views/authorization_usages/index.html.erb