[Rt-commit] r19920 - in rt/3.8/trunk/share/html/Admin: Elements

sartak at bestpractical.com sartak at bestpractical.com
Fri Jun 5 21:04:10 EDT 2009


Author: sartak
Date: Fri Jun  5 21:04:01 2009
New Revision: 19920

Modified:
   rt/3.8/trunk/share/html/Admin/Elements/ConfigureMyRT
   rt/3.8/trunk/share/html/Admin/Global/MyRT.html

Log:
Show the RT at a Glance selection boxes as ReadOnly if there's no
permission to edit them

Modified: rt/3.8/trunk/share/html/Admin/Elements/ConfigureMyRT
==============================================================================
--- rt/3.8/trunk/share/html/Admin/Elements/ConfigureMyRT	(original)
+++ rt/3.8/trunk/share/html/Admin/Elements/ConfigureMyRT	Fri Jun  5 21:04:01 2009
@@ -51,6 +51,7 @@
 $items
 $panes
 $current_portlets
+$ReadOnly => 0
 </%args>
 <%init>
 my $portlets = $current_portlets;
@@ -62,6 +63,7 @@
         Name      => $pane,
         Available => $items,
         AutoSave  => 1,
+        ReadOnly  => $ReadOnly,
         OnSubmit  => sub {
             my $sel = shift;
             $portlets->{$pane} = [

Modified: rt/3.8/trunk/share/html/Admin/Global/MyRT.html
==============================================================================
--- rt/3.8/trunk/share/html/Admin/Global/MyRT.html	(original)
+++ rt/3.8/trunk/share/html/Admin/Global/MyRT.html	Fri Jun  5 21:04:01 2009
@@ -83,15 +83,18 @@
 
 my ($default_portlets) = $sys->Attributes->Named('HomepageSettings');
 
+my $has_right = $session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser');
+
 my @panes = $m->comp(
     '/Admin/Elements/ConfigureMyRT',
     panes  => ['body', 'summary'],
     Action => 'MyRT.html',
     items => \@items,
+    ReadOnly => !$has_right,
     current_portlets => $default_portlets->Content,
     OnSave => sub {
         my ( $conf, $pane ) = @_;
-        if (!$session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
+        if (!$has_right) {
             push @actions, loc( 'Permission denied' );
         }
         else {


More information about the Rt-commit mailing list