[Rt-commit] r19197 - in rt/3.8/trunk: .
alexmv at bestpractical.com
alexmv at bestpractical.com
Tue Apr 14 16:34:04 EDT 2009
Author: alexmv
Date: Tue Apr 14 16:34:03 2009
New Revision: 19197
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/lib/RT/System.pm
Log:
r44293 at kohr-ah: chmrr | 2009-04-14 16:33:10 -0400
Add an AddRights helper method
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 16:34:03 2009
@@ -133,6 +133,21 @@
return(\%rights);
}
+=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.
+
+=end
+
+sub AddRights {
+ my $self = shift;
+ my %new = @_;
+ $RIGHTS = { %$RIGHTS, %new };
+ %RT::ACE::LOWERCASERIGHTNAMES = ( %RT::ACE::LOWERCASERIGHTNAMES,
+ map { lc($_) => $_ } keys %new);
+}
+
sub _Init {
my $self = shift;
$self->SUPER::_Init (@_) if @_ && $_[0];
More information about the Rt-commit
mailing list