Sha256: b0de59f0242fa98f5ff1f2ea039990b82c47e29f1da31017f2f491f05ca23f49

Contents?: true

Size: 1.92 KB

Versions: 6

Compression:

Stored size: 1.92 KB

Contents

digraph rules {
  compound = true
  edge [arrowhead=open]
  node [shape=box,fontname="sans-serif",fontsize="16"]
  fontname="sans-serif";fontsize="16"
  ranksep = "0.3"
  //concentrate = true
  rankdir = TB
  {
    node [shape=ellipse,style=filled]
    //rank = source
    <% @roles.each do |role| %>
    "<%= role.inspect %>" [fillcolor="<%= role_fill_color(role) %>"]
    // ,URL="javascript:set_filter({roles: '<%= role %>'})"
    <% end %>
    <% @roles.each do |role| %>
        <% (@role_hierarchy[role] || []).each do |lower_role| %>
            "<%= role.inspect %>" -> "<%= lower_role.inspect %>" [constraint=false,arrowhead=empty]
        <% end %>
    <% end %>
  }

  <% @contexts.each do |context| %>
    subgraph cluster_<%= context %>  {
      label = "<%= context.inspect %>"
      style=filled; fillcolor="#eeeeee"
      node[fillcolor=white,style=filled]
      <% (@context_privs[context] || []).each do |priv| %>
      <%= priv %>_<%= context %> [label="<%= priv.inspect %>"<%= ',fontcolor="#ff0000"' if @highlight_privilege == priv %>]
      <% end %>
      <% (@context_privs[context] || []).each do |priv| %>
        <% (@privilege_hierarchy[priv] || []).
                select {|p,c| (c.nil? or c == context) and @context_privs[context].include?(p)}.
                each do |lower_priv, c| %>
      <%= priv %>_<%= context %> -> <%= lower_priv %>_<%= context %> [arrowhead=empty]
        <% end %>
      <% end %>
      //read_conferences -> update_conferences [style=invis]
      //create_conferences -> delete_conferences [style=invis]
    }
  <% end %>

  <% @roles.each do |role| %>
    <% (@role_privs[role] || []).each do |context, privilege, unconditionally, attribute_string| %>
  "<%= role.inspect %>" -> <%=  privilege %>_<%= context %> [color="<%= role_color(role) %>", minlen=3<%= ", arrowhead=opendot, URL=\"javascript:\", edgetooltip=\"#{attribute_string.gsub('"','')}\"" unless unconditionally %>]
    <% end %>
  <% end %>
}

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
rubycs-declarative_authorization-0.3.0 app/views/authorization_rules/graph.dot.erb
rubycs-declarative_authorization-0.3.1 app/views/authorization_rules/graph.dot.erb
stffn-declarative_authorization-0.2.3 app/views/authorization_rules/graph.dot.erb
stffn-declarative_authorization-0.2.4 app/views/authorization_rules/graph.dot.erb
stffn-declarative_authorization-0.2.5 app/views/authorization_rules/graph.dot.erb
stffn-declarative_authorization-0.3.0 app/views/authorization_rules/graph.dot.erb