From 17a806108bd81668d818f8c9dc09b3f186978711 Mon Sep 17 00:00:00 2001 From: Ignacio Huerta Date: Sat, 3 Sep 2011 21:16:21 +0200 Subject: [PATCH 1/2] Enable comments in taglibs --- app/models/owned_model.rb | 5 +++-- app/views/api_tag_defs/show.dryml | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/models/owned_model.rb b/app/models/owned_model.rb index 4d5eec1..e8cf32e 100644 --- a/app/models/owned_model.rb +++ b/app/models/owned_model.rb @@ -4,7 +4,8 @@ def create_permitted? - acting_user.signed_up? && user == acting_user + # acting_user.signed_up? && user == acting_user + acting_user.signed_up? end def update_permitted? @@ -19,4 +20,4 @@ def view_permitted?(attribute) true end -end \ No newline at end of file +end diff --git a/app/views/api_tag_defs/show.dryml b/app/views/api_tag_defs/show.dryml index 6bee525..f7043ad 100644 --- a/app/views/api_tag_defs/show.dryml +++ b/app/views/api_tag_defs/show.dryml @@ -51,8 +51,11 @@

Add a Comment

-
- + + + + +
@@ -60,4 +63,4 @@ - \ No newline at end of file + From a8fe9876e30f843f4b6045c6c7c103e96ca2d54c Mon Sep 17 00:00:00 2001 From: Ignacio Huerta Date: Sat, 3 Sep 2011 21:25:45 +0200 Subject: [PATCH 2/2] Improve permissions for new comments --- app/models/owned_model.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/owned_model.rb b/app/models/owned_model.rb index e8cf32e..16d9672 100644 --- a/app/models/owned_model.rb +++ b/app/models/owned_model.rb @@ -4,8 +4,7 @@ def create_permitted? - # acting_user.signed_up? && user == acting_user - acting_user.signed_up? + acting_user.signed_up? && (user == acting_user || new_record?) end def update_permitted?