[Jifty-commit] r3664 - jifty/trunk/lib/Jifty/View/Declare

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Jul 11 13:26:18 EDT 2007


Author: clkao
Date: Wed Jul 11 13:26:18 2007
New Revision: 3664

Modified:
   jifty/trunk/lib/Jifty/View/Declare/CRUD.pm

Log:
Don't bother showing edit link if current user can't

Modified: jifty/trunk/lib/Jifty/View/Declare/CRUD.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/CRUD.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Declare/CRUD.pm	Wed Jul 11 13:26:18 2007
@@ -191,19 +191,20 @@
 };
 
 private template view_item_controls  => sub {
+    my $self = shift;
+    my $record = shift;
 
-        my $self = shift;
-        my $record = shift;
-        my $action = shift;
-        hyperlink(
-            label   => "Edit",
+    if ($record->current_user_can('update')) {
+	hyperlink(
+            label   => _("Edit"),
             class   => "editlink",
             onclick => {
                 replace_with => $self->fragment_for('update'),
                 args         => { object_type => $self->object_type, id => $record->id }
             },
         );
-    };
+    }
+};
 
 
 


More information about the Jifty-commit mailing list