Permalink
Browse files

Permissions?

  • Loading branch information...
1 parent ae2d000 commit ff0f9e653f95820d89b0d33567271639b02d3716 @d1ma d1ma committed Aug 22, 2011
Showing with 10 additions and 1 deletion.
  1. +4 −0 app/views/quotes/index.html.erb
  2. +5 −0 app/views/quotes/new.html.erb
  3. +1 −1 app/views/walls/show.html.erb
@@ -1,6 +1,10 @@
+<% if current_user.has_role(@wall, 'member')
+
Quotes for the wall <%= @wall.name %>
<%= @quotes.each do |q| %>
"<%= q.text %>" submitted by <%= q.author %>
+<% else %>
+<% redirect_to request_membership_path %>
<% end %>
@@ -1,6 +1,11 @@
+<% if current_user.has_role(@wall, 'member')
+
<h1> Create new quote </h1>
<% nested_form_for [@wall, @quote] do |f| %>
<%= f.text_area :text %>
<%= submit_tag "Save" %>
+<% else %>
+<% redirect_to request_membership_path %>
<% end %>
+
@@ -1,4 +1,4 @@
-<% if (current_user.has_role(@wall, 'member') %>
+<% if (current_user.has_role(@wall, 'member')) %>
<%= render 'headbar' %>

0 comments on commit ff0f9e6

Please sign in to comment.