[Rt-commit] r18925 - in rt/3.8/trunk: etc/upgrade/3.8.3 t/customfields
ruz at bestpractical.com
ruz at bestpractical.com
Tue Mar 24 15:17:39 EDT 2009
Author: ruz
Date: Tue Mar 24 15:17:38 2009
New Revision: 18925
Modified:
rt/3.8/trunk/etc/upgrade/3.8.3/content
rt/3.8/trunk/lib/RT/ACE_Overlay.pm
rt/3.8/trunk/lib/RT/Queue_Overlay.pm
rt/3.8/trunk/lib/RT/System.pm
rt/3.8/trunk/lib/RT/User_Overlay.pm
rt/3.8/trunk/t/customfields/access_via_queue.t
Log:
* revert plural/single forms magic for rights, it's too unstable for 3.8
Modified: rt/3.8/trunk/etc/upgrade/3.8.3/content
==============================================================================
--- rt/3.8/trunk/etc/upgrade/3.8.3/content (original)
+++ rt/3.8/trunk/etc/upgrade/3.8.3/content Tue Mar 24 15:17:38 2009
@@ -11,26 +11,6 @@
@Final = (
sub {
- require Lingua::EN::Inflect::Number;
- $RT::Logger->debug("Going to canonicalize ACLs in the DB");
- my $sys = RT::System->new($RT::SystemUser);
-
- my $acl = RT::ACL->new( $RT::SystemUser );
- $acl->UnLimit;
- while ( my $ace = $acl->Next ) {
- my $old = $ace->__Value('RightName');
- my $new = Lingua::EN::Inflect::Number::to_S( $old );
- next if $new eq $old;
-
- my ($status, $msg) = $ace->__Set( Field => 'RightName', Value => $new );
- $RT::Logger->error( "Couldn't change right name: $msg" )
- unless $status;
- }
-
- $RT::Logger->debug("Canonicalized ACLs in the DB.");
- return 1;
- },
- sub {
$RT::Logger->debug("Going to correct descriptions of notify actions in the DB");
my $sys = RT::System->new($RT::SystemUser);
Modified: rt/3.8/trunk/lib/RT/ACE_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/ACE_Overlay.pm (original)
+++ rt/3.8/trunk/lib/RT/ACE_Overlay.pm Tue Mar 24 15:17:38 2009
@@ -70,8 +70,6 @@
use RT::Queues;
use RT::Groups;
-use Lingua::EN::Inflect::Number;
-
use vars qw (
%LOWERCASERIGHTNAMES
%OBJECT_TYPES
@@ -563,20 +561,10 @@
=cut
-our %CANONICRIGHTNAMES = ();
-{ my $keys_cached = 0;
sub CanonicalizeRightName {
my $self = shift;
- unless ( $keys_cached == keys %LOWERCASERIGHTNAMES ) {
- foreach my $right ( values %LOWERCASERIGHTNAMES ) {
- $right = Lingua::EN::Inflect::Number::to_S( $right );
- $CANONICRIGHTNAMES{ lc $right } = $right;
- $CANONICRIGHTNAMES{ lc Lingua::EN::Inflect::Number::to_PL( $right ) } = $right;
- }
- $keys_cached = keys %LOWERCASERIGHTNAMES;
- }
- return $CANONICRIGHTNAMES{ lc shift };
-} }
+ return $LOWERCASERIGHTNAMES{ lc shift };
+}
# }}}
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 Mar 24 15:17:38 2009
@@ -93,8 +93,8 @@
ShowACL => 'Display Access Control List', # loc_pair
ModifyACL => 'Modify Access Control List', # loc_pair
ModifyQueueWatchers => 'Modify the queue watchers', # loc_pair
- SeeCustomFields => 'See custom field values', # loc_pair
- ModifyCustomFields => 'Modify custom field values', # loc_pair
+ SeeCustomField => 'See custom field values', # loc_pair
+ ModifyCustomField => 'Modify custom field values', # loc_pair
AssignCustomFields => 'Assign and remove custom fields', # loc_pair
ModifyTemplate => 'Modify Scrip templates for this queue', # loc_pair
ShowTemplate => 'Display Scrip templates for this queue', # loc_pair
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 Mar 24 15:17:38 2009
@@ -130,11 +130,6 @@
# Build a merged list of all system wide rights, queue rights and group rights.
my %rights = (%{$RIGHTS}, %{$gr}, %{$qr}, %{$cr});
- # prefer plural forms
- foreach my $right ( grep !/s$/, keys %rights ) {
- delete $rights{ $right } if exists $rights{ $right .'s' };
- }
-
return(\%rights);
}
Modified: rt/3.8/trunk/lib/RT/User_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/User_Overlay.pm (original)
+++ rt/3.8/trunk/lib/RT/User_Overlay.pm Tue Mar 24 15:17:38 2009
@@ -1502,7 +1502,7 @@
IncludeGroupMembership => 1);
$deleg_acl->Limit( FIELD => 'RightName',
OPERATOR => '=',
- VALUE => 'DelegateRight' );
+ VALUE => 'DelegateRights' );
my @allowed_deleg_objects = map {$_->Object()}
@{$deleg_acl->ItemsArrayRef()};
Modified: rt/3.8/trunk/t/customfields/access_via_queue.t
==============================================================================
--- rt/3.8/trunk/t/customfields/access_via_queue.t (original)
+++ rt/3.8/trunk/t/customfields/access_via_queue.t Tue Mar 24 15:17:38 2009
@@ -38,8 +38,8 @@
ok( RT::Test->set_rights(
{ Principal => $tester, Right => [qw(SeeQueue ShowTicket CreateTicket ReplyToTicket Watch OwnTicket TakeTicket)] },
- { Principal => $cc_role, Object => $queue, Right => [qw(SeeCustomFields)] },
- { Principal => $owner_role, Object => $queue, Right => [qw(ModifyCustomFields)] },
+ { Principal => $cc_role, Object => $queue, Right => [qw(SeeCustomField)] },
+ { Principal => $owner_role, Object => $queue, Right => [qw(ModifyCustomField)] },
), 'set rights');
{
@@ -157,7 +157,5 @@
ok $m->goto_ticket( $tid ), "opened ticket";
$m->content_like(qr/$cf_name/, "changed cf");
-
-
}
More information about the Rt-commit
mailing list