Diff
Modified: branches/authorization_new/app/helpers/application_helper.rb (2060 => 2061)
--- branches/authorization_new/app/helpers/application_helper.rb 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/helpers/application_helper.rb 2009-01-16 16:09:27 UTC (rev 2061)
@@ -1050,6 +1050,8 @@
end
def thing_authorized?(action, thing)
+ # method preserved only in case some code absolutely requires it in the future;
+ # for now (Jan 2009) all occurrences of it's usage were replaced with Authorization.is_authorized?()
return Authorization.is_authorized?(action, nil, thing, current_user)
end
Modified: branches/authorization_new/app/views/blobs/_table.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/blobs/_table.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/blobs/_table.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -49,7 +49,7 @@
<p style="font-size:85%;">
<b>Attributions:</b>
<% attributors.each do |a| %>
- <% if thing_authorized?('show', a.attributor) -%>
+ <% if Authorization.is_authorized?("show", nil, a.attributor, current_user) -%>
<% if a.attributor_type == 'Workflow' %>
<%= icon('workflow', nil, nil, nil, '') %>
<% elsif a.attributor_type == 'Blob' %>
Modified: branches/authorization_new/app/views/contributions/_attributed_by.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/contributions/_attributed_by.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/contributions/_attributed_by.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -16,7 +16,7 @@
<% if a.attributable.nil? -%>
<span class="none_text">Item doesn't exist anymore</span>
<% else -%>
- <% if thing_authorized?('show', a.attributable) -%>
+ <% if Authorization.is_authorized?("show", nil, a.attributable, current_user) -%>
<% if a.attributable_type == 'Workflow' %>
<%= icon('workflow', nil, nil, nil, '') %>
<% elsif a.attributable_type == 'Blob' %>
Modified: branches/authorization_new/app/views/contributions/_credit_attribution_form.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/contributions/_credit_attribution_form.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/contributions/_credit_attribution_form.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -214,7 +214,7 @@
// Attributions
<% contributable.attributors.each do |a| %>
- <% if thing_authorized?('show', a.attributor) -%>
+ <% if Authorization.is_authorized?("show", nil, a.attributor, current_user) -%>
<% if a.attributor_type == 'Workflow' %>
attributions_workflows[<%= a.attributor_id %>] = '<%= escape_javascript contributable_name(a.attributor_id, 'Workflow') %>';
<% elsif a.attributor_type == 'Blob' %>
Modified: branches/authorization_new/app/views/contributions/_credits_attributions_box.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/contributions/_credits_attributions_box.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/contributions/_credits_attributions_box.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -45,7 +45,7 @@
<% if a.attributor.nil? -%>
<span class="none_text">Item doesn't exist anymore</span>
<% else -%>
- <% if thing_authorized?('show', a.attributor) -%>
+ <% if Authorization.is_authorized?("show", nil, a.attributor, current_user) -%>
<% if a.attributor_type == 'Workflow' %>
<%= icon('workflow', nil, nil, nil, '') %>
<% elsif a.attributor_type == 'Blob' %>
Modified: branches/authorization_new/app/views/contributions/_in_packs_box.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/contributions/_in_packs_box.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/contributions/_in_packs_box.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -10,7 +10,7 @@
<ul class="items">
<% packs.each do |p| %>
<li>
- <% if thing_authorized?('show', p) -%>
+ <% if Authorization.is_authorized?("show", nil, p, current_user) -%>
<%= icon('pack', nil, nil, nil, '') %>
<%= contributable(p.id, 'Pack') %>
<% else -%>
Modified: branches/authorization_new/app/views/home/_latest_comments.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/home/_latest_comments.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/home/_latest_comments.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -9,7 +9,7 @@
<% unless (comments = Comment.latest).empty? %>
<ul class="list">
<% comments.each do |c| %>
- <% if thing_authorized?('show', c.commentable) %>
+ <% if Authorization.is_authorized?("show", nil, c.commentable, current_user) %>
<li>
<b><%= c_type = visible_name(c.commentable_type); icon(c.commentable_type.to_s, nil, nil, c_type, c_type) %>:</b>
<span><%= c.commentable_type == 'Network' ? title(c.commentable_id) : contributable(c.commentable_id, c.commentable_type) %></span>
Modified: branches/authorization_new/app/views/home/_latest_groups.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/home/_latest_groups.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/home/_latest_groups.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -9,7 +9,7 @@
<% unless (groups = Network.recently_created).empty? %>
<ul class="list" style="font-size: 85%;">
<% groups.each do |g| %>
- <% if thing_authorized?('show', g) %>
+ <% if Authorization.is_authorized?("show", nil, g, current_user) %>
<li>
<%= icon('network', nil, nil, 'group icon', '') %>
<b><%= link_to g.title, group_path(g) %></b>
Modified: branches/authorization_new/app/views/home/_latest_reviews.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/home/_latest_reviews.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/home/_latest_reviews.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -9,7 +9,7 @@
<% unless (reviews = Review.latest).empty? %>
<ul class="list">
<% reviews.each do |r| %>
- <% if thing_authorized?('show', r.reviewable) %>
+ <% if Authorization.is_authorized?("show", nil, r.reviewable, current_user) %>
<li>
<b><%= r_type = visible_name(r.reviewable_type); icon(r.reviewable_type.to_s, nil, nil, r_type, r_type) %>:</b>
<span><%= contributable(r.reviewable_id, r.reviewable_type) %></span>
Modified: branches/authorization_new/app/views/home/_latest_tags.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/home/_latest_tags.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/home/_latest_tags.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -9,7 +9,7 @@
<% unless (taggings = Tagging.latest(20)).empty? %>
<ul class="list" style="font-size: 85%;">
<% taggings.each do |t| %>
- <% if thing_authorized?('show', t.taggable) %>
+ <% if Authorization.is_authorized?("show", nil, t.taggable, current_user) %>
<li>
<span class="box_standout" style="padding: 0.1em 0.4em;">
<b><%= link_to_tag(t.tag) %></b>
Modified: branches/authorization_new/app/views/home/_updated_items.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/home/_updated_items.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/home/_updated_items.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -8,7 +8,7 @@
<% unless (contributions = Contribution.last_updated(15)).empty? %>
<ul class="list">
<% contributions.each do |c| %>
- <% if thing_authorized?('show', c) %>
+ <% if Authorization.is_authorized?("show", nil, c, current_user) %>
<li>
<b><%= c_type = visible_name(c.contributable_type); icon(c.contributable_type.to_s, nil, nil, c_type, c_type) %>:</b>
<%= c.contributable_type == 'Network' ? title(c.contributable_id) : contributable(c.contributable_id, c.contributable_type) %>
Modified: branches/authorization_new/app/views/layouts/_pack_items.rxml (2060 => 2061)
--- branches/authorization_new/app/views/layouts/_pack_items.rxml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/layouts/_pack_items.rxml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -1,5 +1,5 @@
pack.contributable_entries.each do |e|
- show = e.available? ? thing_authorized?('show', e.contributable) : false
+ show = e.available? ? Authorization.is_authorized?("show", nil, e.contributable, current_user) : false
xm.item do
if show
xm.title "#{visible_name(e.contributable_type)}: #{contributable_name(e.contributable_id, e.contributable_type)}"
Modified: branches/authorization_new/app/views/packs/_items.rhtml (2060 => 2061)
--- branches/authorization_new/app/views/packs/_items.rhtml 2009-01-16 15:59:48 UTC (rev 2060)
+++ branches/authorization_new/app/views/packs/_items.rhtml 2009-01-16 16:09:27 UTC (rev 2061)
@@ -11,7 +11,7 @@
<!-- Contributable Item Entries -->
<% pack.contributable_entries.each do |e| %>
- <% show = e.available? ? thing_authorized?('show', e.contributable) : false -%>
+ <% show = e.available? ? Authorization.is_authorized?("show", nil, e.contributable, current_user) : false -%>
<li>
<table>
<tr>