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

Shawn Moore sartak at bestpractical.com
Tue Mar 22 13:09:40 EDT 2011


The branch, 4.2/dashboard-tables has been updated
       via  3e62d98da3d066e3b3593d44586667c5ffda7a4e (commit)
      from  6643907e8d81ed6b1dd8775b604600dde150d936 (commit)

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

- Log -----------------------------------------------------------------
commit 3e62d98da3d066e3b3593d44586667c5ffda7a4e
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Mar 22 13:08:56 2011 -0400

    Dashboards->LimitToObject

diff --git a/lib/RT/Dashboards.pm b/lib/RT/Dashboards.pm
index 3509a0a..58ccd63 100644
--- a/lib/RT/Dashboards.pm
+++ b/lib/RT/Dashboards.pm
@@ -76,6 +76,21 @@ sub RecordClass {
     return 'RT::Dashboard';
 }
 
+=head2 LimitToObject
+
+The Dashboards object will load the dashboards belonging to the passed-in user
+or group. Repeated calls to the same object should DTRT.
+
+=cut
+
+sub LimitToObject {
+    my $self = shift;
+    my $obj  = shift;
+
+    my $privacy = join('-',ref($obj),$obj->Id);
+    return $self->LimitToPrivacy($privacy);
+}
+
 =head2 LimitToPrivacy
 
 Takes one argument: a privacy string, of the format "<class>-<id>", as produced

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


More information about the Rt-commit mailing list