[Rt-commit] rt branch, 4.2/dashboard-tables, updated. rt-4.0.0rc6-187-g0409c5d

Shawn Moore sartak at bestpractical.com
Tue Mar 22 14:39:27 EDT 2011


The branch, 4.2/dashboard-tables has been updated
       via  0409c5dd12140ca31853d5ffbd5e8004062c4849 (commit)
      from  414eb7f19a09874e9b6e80e89b2bd631e069714a (commit)

Summary of changes:
 lib/RT/Dashboard.pm |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit 0409c5dd12140ca31853d5ffbd5e8004062c4849
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Mar 22 14:38:06 2011 -0400

    RT::Dashboard->Create which accepts Privacy

diff --git a/lib/RT/Dashboard.pm b/lib/RT/Dashboard.pm
index 8759f2b..0fdcbd3 100644
--- a/lib/RT/Dashboard.pm
+++ b/lib/RT/Dashboard.pm
@@ -100,6 +100,24 @@ RT::System::AddRightCategories(
     DeleteOwnDashboard => 'Staff',
 );
 
+=head2 Create
+
+Accepts a C<Privacy> instead of an C<ObjectType> and C<ObjectId>.
+
+=cut
+
+sub Create {
+    my $self = shift;
+    my %args = @_;
+
+    # canonicalize Privacy into ObjectType and ObjectId
+    if ($args{Privacy}) {
+        ($args{ObjectType}, $args{ObjectId}) = split '-', delete $args{Privacy};
+    }
+
+    return $self->SUPER::Create(%args);
+}
+
 =head2 Panes
 
 Returns a hashref of pane name to portlets

-----------------------------------------------------------------------


More information about the Rt-commit mailing list