summaryrefslogtreecommitdiffstats
path: root/app/views/queries
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/queries')
-rw-r--r--app/views/queries/_form.rhtml2
-rw-r--r--app/views/queries/index.rhtml6
2 files changed, 3 insertions, 5 deletions
diff --git a/app/views/queries/_form.rhtml b/app/views/queries/_form.rhtml
index 9482bd33a..d641fa0b5 100644
--- a/app/views/queries/_form.rhtml
+++ b/app/views/queries/_form.rhtml
@@ -5,7 +5,7 @@
<p><label for="query_name"><%=l(:field_name)%></label>
<%= text_field 'query', 'name', :size => 80 %></p>
-<% if authorize_for('projects', 'add_query') %>
+<% if current_role.allowed_to?(:manage_pulic_queries) %>
<p><label for="query_is_public"><%=l(:field_is_public)%></label>
<%= check_box 'query', 'is_public' %></p>
<% end %>
diff --git a/app/views/queries/index.rhtml b/app/views/queries/index.rhtml
index 69cfb8f98..71aa37497 100644
--- a/app/views/queries/index.rhtml
+++ b/app/views/queries/index.rhtml
@@ -1,7 +1,5 @@
<div class="contextual">
-<% if loggedin? %>
-<%= link_to l(:label_query_new), {:controller => 'queries', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>
-<% end %>
+<%= link_to_if_authorized l(:label_query_new), {:controller => 'queries', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>
</div>
<h2><%= l(:label_query_plural) %></h2>
@@ -17,7 +15,7 @@
</td>
<td align="right">
<small>
- <% if query.editable_by?(@logged_in_user) %>
+ <% if query.editable_by?(User.current) %>
<%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => query}, :class => 'icon icon-edit' %>
<%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
</small>