[Rt-commit] r13701 - in rt/3.8/trunk: sbin
sartak at bestpractical.com
sartak at bestpractical.com
Mon Jun 30 21:46:40 EDT 2008
Author: sartak
Date: Mon Jun 30 21:46:39 2008
New Revision: 13701
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/sbin/rt-email-dashboards.in
Log:
r63536 at onn: sartak | 2008-06-30 21:46:25 -0400
Better ACL check in rt-email-dashboards
Modified: rt/3.8/trunk/sbin/rt-email-dashboards.in
==============================================================================
--- rt/3.8/trunk/sbin/rt-email-dashboards.in (original)
+++ rt/3.8/trunk/sbin/rt-email-dashboards.in Mon Jun 30 21:46:39 2008
@@ -142,15 +142,6 @@
next;
}
- if (!$opts{"skip-acl"}) {
- unless ($user->HasRight(Right => 'SubscribeDashboard', Object => $RT::System)) {
- vverbose "Skipping over "
- . $user->Name
- . " due to lack of SubscribeDashboard right.";
- next;
- }
- }
-
my ($hour, $dow, $dom) = hour_dow_dom_in($user->Timezone || 'UTC');
$hour .= ':00';
vverbose "Checking [_1]'s subscriptions: hour [_2], dow [_3], dom [_4]",
@@ -192,14 +183,15 @@
my $dashboard = RT::Dashboard->new($currentuser);
- $dashboard->LoadById($subscription->SubValue('DashboardId'));
+ my ($ok, $msg) = $dashboard->LoadById($subscription->SubValue('DashboardId'));
- # failed to load dashboard. perhaps it was deleted?
- if (!$dashboard->Id) {
- warning "Unable to load dashboard [_1] of subscription [_2] for user [_3]",
+ # failed to load dashboard. perhaps it was deleted or it changed privacy
+ if (!$ok) {
+ warning "Unable to load dashboard [_1] of subscription [_2] for user [_3]: [_4]",
$subscription->SubValue('DashboardId'),
$subscription->Id,
- $currentuser->Name;
+ $currentuser->Name,
+ $msg;
my $ok = RT::Interface::Email::SendEmailUsingTemplate(
From => $from,
@@ -543,10 +535,6 @@
Disable checking of whether each subscription should be sent right now (should
only be used with --dryrun)
-=item --skip-acl
-
-Skip SubscribeDashboard access control checks
-
=back
=cut
More information about the Rt-commit
mailing list