[Rt-commit] r2691 - in rt/branches/PLATANO-EXPERIMENTAL-CSS: . etc
html/Elements html/Prefs html/Search html/Widgets
jesse at bestpractical.com
jesse at bestpractical.com
Sat Apr 16 04:14:35 EDT 2005
Author: jesse
Date: Sat Apr 16 04:14:35 2005
New Revision: 2691
Modified:
rt/branches/PLATANO-EXPERIMENTAL-CSS/ (props changed)
rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/RT_Config.pm.in
rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Elements/MyRT
rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Prefs/MyRT.html
rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Search/Build.html
rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Widgets/SelectionBox
Log:
r13080 at hualien: jesse | 2005-04-16 03:01:17 -0400
r12974 at hualien: jesse | 2005-04-16 02:16:34 -0400
r6745 at hualien: jesse | 2005-03-10 17:13:01 -0500
r6660 at hualien (orig r2333): clkao | 2005-03-10 09:52:26 -0500
* Make AllowedComponent configurable in RT_Config.
* Check selected are within given Available ones.
* Check permission when saving searches for rt::system.
Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/RT_Config.pm.in
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/RT_Config.pm.in (original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/RT_Config.pm.in Sat Apr 16 04:14:35 2005
@@ -371,6 +371,11 @@
Set($DefaultSummaryRows, 10);
+
+# $MaxInlineBody is an arrayref of allowed components customized homepage.
+
+Set($HomepageComponents, [qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues RefreshHomepage)]);
+
# @MasonParameters is the list of parameters for the constructor of
# HTML::Mason's Apache or CGI Handler. This is normally only useful
# for debugging, eg. profiling individual components with:
Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Elements/MyRT
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Elements/MyRT (original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Elements/MyRT Sat Apr 16 04:14:35 2005
@@ -68,8 +68,7 @@
<%INIT>
-my %allowed_components = map {$_ => 1}
- qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues RefreshHomepage);
+my %allowed_components = map {$_ => 1} @{$RT::HomepageComponents};
unless (exists $session{'my_rt_portlets'}) {
my ($d_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Prefs/MyRT.html
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Prefs/MyRT.html (original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Prefs/MyRT.html Sat Apr 16 04:14:35 2005
@@ -87,8 +87,7 @@
my $portlets = $session{'my_rt_portlets'};
-my %allowed_components = map {$_ => 1}
- qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues RefreshHomepage);
+my %allowed_components = map {$_ => 1} @{$RT::HomepageComponents};
my @items;
push @items, map {["component-$_", $_]} sort keys %allowed_components;
Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Search/Build.html
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Search/Build.html (original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Search/Build.html Sat Apr 16 04:14:35 2005
@@ -758,7 +758,12 @@
# {{{ if we're asked to save the current search, save it
if ( $ARGS{'Save'} ) {
-
+ # permission check
+ if ($search->Object->isa('RT::System')) {
+ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
+ Abort("No permission to save system-wide searches");
+ }
+ }
if ( $search && $search->id ) {
# This search is based on a previously loaded search -- so
Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Widgets/SelectionBox
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Widgets/SelectionBox (original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Widgets/SelectionBox Sat Apr 16 04:14:35 2005
@@ -77,6 +77,7 @@
<%method new>
<%init>
+$ARGS{_item_map} = {map {$_->[0] => $_->[1]} @{$ARGS{Available}}};
return \%ARGS;
</%init>
</%method>
@@ -141,7 +142,7 @@
$self->{Current} = $current;
}
-# XXX: Verify Current are within $self->{Available} here
+@{$self->{Current}} = grep { exists $self->{_item_map}{$_} } @{$self->{Current}};
if ($ARGS{$self->{Name}.'-Save'}) {
$self->{OnSubmit}->($self);
@@ -189,7 +190,7 @@
% if (exists $selected{$_}) {
SELECTED
% }
-><% $item_map{$_} %></option>
+><% $self->{_item_map}{$_} %></option>
% }
</select>
<input name="moveup" type="submit" value="^"/>
@@ -210,7 +211,6 @@
<%INIT>
my $name = $self->{Name};
my %selected = map {$_ => 1} @{$self->{Selected}};
-my %item_map = map {$_->[0] => $_->[1]} @{$self->{Available}};
</%INIT>
</%method>
More information about the Rt-commit
mailing list