[Rt-commit] rt branch, 4.0/group-dashboards, updated. rt-4.0.1-138-gd258f53
Alex Vandiver
alexmv at bestpractical.com
Wed Jul 20 21:11:42 EDT 2011
The branch, 4.0/group-dashboards has been updated
via d258f535e789a62590858640df387af331da54bd (commit)
via c5a3dd2406ae4cab3e300dd4af2ee104a176662d (commit)
from 469aff87d02d1fa6115c55cf93f5350274e3be96 (commit)
Summary of changes:
lib/RT/Dashboard.pm | 4 ++--
share/html/Dashboards/Elements/ListOfDashboards | 4 ++--
share/html/Dashboards/Elements/ShowDashboards | 5 ++++-
share/html/Elements/Dashboards | 2 +-
share/html/Elements/Tabs | 2 +-
t/web/dashboards-groups.t | 4 ++--
6 files changed, 12 insertions(+), 9 deletions(-)
- Log -----------------------------------------------------------------
commit c5a3dd2406ae4cab3e300dd4af2ee104a176662d
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Jul 20 21:05:18 2011 -0400
Rename IncludeSuperusers in ObjectsForLoading to reflect that it only acts on group rights
diff --git a/lib/RT/Dashboard.pm b/lib/RT/Dashboard.pm
index 0822b0b..135babb 100644
--- a/lib/RT/Dashboard.pm
+++ b/lib/RT/Dashboard.pm
@@ -380,7 +380,7 @@ sub Subscription {
sub ObjectsForLoading {
my $self = shift;
my %args = (
- IncludeSuperusers => 1,
+ IncludeSuperuserGroups => 1,
@_
);
my @objects;
@@ -399,7 +399,7 @@ sub ObjectsForLoading {
$groups->LimitToUserDefinedGroups;
$groups->ForWhichCurrentUserHasRight(
Right => 'SeeGroupDashboard',
- %args,
+ IncludeSuperusers => $args{IncludeSuperuserGroups},
);
$groups->WithMember(
Recursively => 1,
diff --git a/share/html/Dashboards/Elements/ListOfDashboards b/share/html/Dashboards/Elements/ListOfDashboards
index 3927e7a..49a48ad 100644
--- a/share/html/Dashboards/Elements/ListOfDashboards
+++ b/share/html/Dashboards/Elements/ListOfDashboards
@@ -50,7 +50,7 @@
use RT::Dashboard;
my @objs = RT::Dashboard->new($session{CurrentUser})->ObjectsForLoading(
- IncludeSuperusers => $IncludeSuperusers
+ IncludeSuperuserGroups => $IncludeSuperuserGroups
);
my %dashboard_map;
@@ -78,5 +78,5 @@ $m->callback(%ARGS, dashboards => \@dashboards, CallbackName => 'ModifyDashboard
return @dashboards;
</%init>
<%args>
-$IncludeSuperusers => 1
+$IncludeSuperuserGroups => 1
</%args>
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 5db9bc3..2ad66bd 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -65,7 +65,7 @@ my $build_main_nav = sub {
# groups you're not in (but can see the dashboards of by dint of
# being a superuser) would push the useful ones from the groups
# you're actually in off of the stack.
- my @dashboards = $m->comp("/Dashboards/Elements/ListOfDashboards", IncludeSuperusers => 0);
+ my @dashboards = $m->comp("/Dashboards/Elements/ListOfDashboards", IncludeSuperuserGroups => 0);
my $limit = 7;
my $more = 0;
diff --git a/t/web/dashboards-groups.t b/t/web/dashboards-groups.t
index 6726d17..ac2a5ac 100644
--- a/t/web/dashboards-groups.t
+++ b/t/web/dashboards-groups.t
@@ -166,7 +166,7 @@ is_deeply(
["RT::User-".$user_obj->Id, "RT::System-1"],
"We pick up the system-level SeeDashboard right from superuser"
);
- at loading = map {ref($_)."-".$_->Id} RT::Dashboard->new($currentuser)->ObjectsForLoading(IncludeSuperusers => 0);
+ at loading = map {ref($_)."-".$_->Id} RT::Dashboard->new($currentuser)->ObjectsForLoading(IncludeSuperuserGroups => 0);
is_deeply(
\@loading,
["RT::User-".$user_obj->Id, "RT::System-1"],
@@ -182,7 +182,7 @@ is_deeply(
["RT::User-".$user_obj->Id, "RT::Group-".$inner_group->Id, "RT::System-1"],
"Becoming a member of the group makes it a possibility"
);
- at loading = map {ref($_)."-".$_->Id} RT::Dashboard->new($currentuser)->ObjectsForLoading(IncludeSuperusers => 0);
+ at loading = map {ref($_)."-".$_->Id} RT::Dashboard->new($currentuser)->ObjectsForLoading(IncludeSuperuserGroups => 0);
is_deeply(
\@loading,
["RT::User-".$user_obj->Id, "RT::System-1"],
commit d258f535e789a62590858640df387af331da54bd
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Jul 20 21:06:03 2011 -0400
Make the dashboard portlet not include groups visible because of superuser privs, like the menu
diff --git a/share/html/Dashboards/Elements/ShowDashboards b/share/html/Dashboards/Elements/ShowDashboards
index ec32426..e0b8626 100644
--- a/share/html/Dashboards/Elements/ShowDashboards
+++ b/share/html/Dashboards/Elements/ShowDashboards
@@ -64,5 +64,8 @@
<%init>
use RT::Dashboards;
-my @Objects = RT::Dashboard->new($session{CurrentUser})->ObjectsForLoading;
+my @Objects = RT::Dashboard->new($session{CurrentUser})->ObjectsForLoading(IncludeSuperuserGroups => $IncludeSuperuserGroups);
</%init>
+<%args>
+$IncludeSuperuserGroups => 1
+</%args>
diff --git a/share/html/Elements/Dashboards b/share/html/Elements/Dashboards
index cccae74..77eccde 100644
--- a/share/html/Elements/Dashboards
+++ b/share/html/Elements/Dashboards
@@ -52,6 +52,6 @@
titleright_href => RT->Config->Get('WebPath').'/Dashboards/index.html',
&>
-<& /Dashboards/Elements/ShowDashboards &>
+<& /Dashboards/Elements/ShowDashboards, IncludeSuperuserGroups => 0 &>
</&>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list