[Rt-commit] r19198 - in rt/3.8/trunk: .

alexmv at bestpractical.com alexmv at bestpractical.com
Tue Apr 14 17:54:37 EDT 2009


Author: alexmv
Date: Tue Apr 14 17:54:36 2009
New Revision: 19198

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/CustomField_Overlay.pm
   rt/3.8/trunk/lib/RT/Dashboard.pm
   rt/3.8/trunk/lib/RT/Group_Overlay.pm
   rt/3.8/trunk/lib/RT/Queue_Overlay.pm
   rt/3.8/trunk/lib/RT/System.pm

Log:
 r44301 at kohr-ah:  chmrr | 2009-04-14 17:54:22 -0400
 Add ->AddRights method to other right-enabled models


Modified: rt/3.8/trunk/lib/RT/CustomField_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/CustomField_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/CustomField_Overlay.pm	Tue Apr 14 17:54:36 2009
@@ -121,6 +121,21 @@
     $RT::ACE::LOWERCASERIGHTNAMES{ lc $right } = $right;
 }
 
+=head2 AddRights C<RIGHT>, C<DESCRIPTION> [, ...]
+
+Adds the given rights to the list of possible rights.  This method
+should be called during server startup, not at runtime.
+
+=cut
+
+sub AddRights {
+    my $self = shift;
+    my %new = @_;
+    $RIGHTS = { %$RIGHTS, %new };
+    %RT::ACE::LOWERCASERIGHTNAMES = ( %RT::ACE::LOWERCASERIGHTNAMES,
+                                      map { lc($_) => $_ } keys %new);
+}
+
 sub AvailableRights {
     my $self = shift;
     return $RIGHTS;

Modified: rt/3.8/trunk/lib/RT/Dashboard.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Dashboard.pm	(original)
+++ rt/3.8/trunk/lib/RT/Dashboard.pm	Tue Apr 14 17:54:36 2009
@@ -73,7 +73,8 @@
 use warnings;
 use base qw/RT::SharedSetting/;
 
-my %new_rights = (
+use RT::System;
+RT::System->AddRights(
     SubscribeDashboard => 'Subscribe to dashboards', #loc_pair
 
     SeeDashboard       => 'View system dashboards', #loc_pair
@@ -87,10 +88,6 @@
     DeleteOwnDashboard => 'Delete personal dashboards', #loc_pair
 );
 
-use RT::System;
-$RT::System::RIGHTS = { %$RT::System::RIGHTS, %new_rights };
-%RT::ACE::LOWERCASERIGHTNAMES = ( %RT::ACE::LOWERCASERIGHTNAMES,
-                                  map { lc($_) => $_ } keys %new_rights);
 
 =head2 ObjectName
 

Modified: rt/3.8/trunk/lib/RT/Group_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Group_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Group_Overlay.pm	Tue Apr 14 17:54:36 2009
@@ -113,6 +113,20 @@
     $RT::ACE::LOWERCASERIGHTNAMES{ lc $right } = $right;
 }
 
+=head2 AddRights C<RIGHT>, C<DESCRIPTION> [, ...]
+
+Adds the given rights to the list of possible rights.  This method
+should be called during server startup, not at runtime.
+
+=cut
+
+sub AddRights {
+    my $self = shift;
+    my %new = @_;
+    $RIGHTS = { %$RIGHTS, %new };
+    %RT::ACE::LOWERCASERIGHTNAMES = ( %RT::ACE::LOWERCASERIGHTNAMES,
+                                      map { lc($_) => $_ } keys %new);
+}
 
 =head2 AvailableRights
 

Modified: rt/3.8/trunk/lib/RT/Queue_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Queue_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Queue_Overlay.pm	Tue Apr 14 17:54:36 2009
@@ -130,7 +130,21 @@
 foreach my $right ( keys %{$RIGHTS} ) {
     $RT::ACE::LOWERCASERIGHTNAMES{ lc $right } = $right;
 }
-    
+
+=head2 AddRights C<RIGHT>, C<DESCRIPTION> [, ...]
+
+Adds the given rights to the list of possible rights.  This method
+should be called during server startup, not at runtime.
+
+=cut
+
+sub AddRights {
+    my $self = shift;
+    my %new = @_;
+    $RIGHTS = { %$RIGHTS, %new };
+    %RT::ACE::LOWERCASERIGHTNAMES = ( %RT::ACE::LOWERCASERIGHTNAMES,
+                                      map { lc($_) => $_ } keys %new);
+}
 
 sub AddLink {
     my $self = shift;

Modified: rt/3.8/trunk/lib/RT/System.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/System.pm	(original)
+++ rt/3.8/trunk/lib/RT/System.pm	Tue Apr 14 17:54:36 2009
@@ -138,7 +138,7 @@
 Adds the given rights to the list of possible rights.  This method
 should be called during server startup, not at runtime.
 
-=end
+=cut
 
 sub AddRights {
     my $self = shift;


More information about the Rt-commit mailing list