[Rt-commit] r10637 - in rt/branches/3.999-DANGEROUS: lib lib/RT/Model t/delegation
ruz at bestpractical.com
ruz at bestpractical.com
Thu Jan 31 20:45:57 EST 2008
Author: ruz
Date: Thu Jan 31 20:45:56 2008
New Revision: 10637
Modified:
rt/branches/3.999-DANGEROUS/lib/RT.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMember.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMember.pm
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CachedGroupMember.pm
rt/branches/3.999-DANGEROUS/t/delegation/cleanup_stalled.t
rt/branches/3.999-DANGEROUS/t/delegation/revocation.t
Log:
* lowerings in Group, GM and CGM
Modified: rt/branches/3.999-DANGEROUS/lib/RT.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT.pm Thu Jan 31 20:45:56 2008
@@ -12,32 +12,32 @@
use vars qw($Config $System $nobody $Handle );
our $VERSION = '3.7.14';
-our $BASE_PATH = '/home/jesse/svk/3.999-DANGEROUS';
-our $EtcPath = '/home/jesse/svk/3.999-DANGEROUS/etc';
-our $BinPath = '/home/jesse/svk/3.999-DANGEROUS/bin';
-our $VarPath = '/home/jesse/svk/3.999-DANGEROUS/var';
-our $LocalPath = '/home/jesse/svk/3.999-DANGEROUS/local';
-our $LocalLibPath = '/home/jesse/svk/3.999-DANGEROUS/local/lib';
-our $LocalEtcPath = '/home/jesse/svk/3.999-DANGEROUS/local/etc';
-our $LocalLexiconPath = '/home/jesse/svk/3.999-DANGEROUS/local/po';
+our $BASE_PATH = '/home/cubic/projs/RT/3.999-DANGEROUS';
+our $EtcPath = '/home/cubic/projs/RT/3.999-DANGEROUS/etc';
+our $BinPath = '/home/cubic/projs/RT/3.999-DANGEROUS/bin';
+our $VarPath = '/home/cubic/projs/RT/3.999-DANGEROUS/var';
+our $LocalPath = '/home/cubic/projs/RT/3.999-DANGEROUS/local';
+our $LocalLibPath = '/home/cubic/projs/RT/3.999-DANGEROUS/local/lib';
+our $LocalEtcPath = '/home/cubic/projs/RT/3.999-DANGEROUS/local/etc';
+our $LocalLexiconPath = '/home/cubic/projs/RT/3.999-DANGEROUS/local/po';
our $LocalPluginPath = $LocalPath . "/plugins";
# $MasonComponentRoot is where your rt instance keeps its mason html files
-our $MasonComponentRoot = '/home/jesse/svk/3.999-DANGEROUS/html';
+our $MasonComponentRoot = '/home/cubic/projs/RT/3.999-DANGEROUS/html';
# $MasonLocalComponentRoot is where your rt instance keeps its site-local
# mason html files.
-our $MasonLocalComponentRoot = '/home/jesse/svk/3.999-DANGEROUS/local/html';
+our $MasonLocalComponentRoot = '/home/cubic/projs/RT/3.999-DANGEROUS/local/html';
# $MasonDataDir Where mason keeps its datafiles
-our $MasonDataDir = '/home/jesse/svk/3.999-DANGEROUS/var/mason_data';
+our $MasonDataDir = '/home/cubic/projs/RT/3.999-DANGEROUS/var/mason_data';
# RT needs to put session data (for preserving state between connections
# via the web interface)
-our $MasonSessionDir = '/home/jesse/svk/3.999-DANGEROUS/var/session_data';
+our $MasonSessionDir = '/home/cubic/projs/RT/3.999-DANGEROUS/var/session_data';
=head1 name
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMember.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMember.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/CachedGroupMember.pm Thu Jan 31 20:45:56 2008
@@ -59,24 +59,24 @@
sub create {
my $self = shift;
my %args = (
- Group => '',
- Member => '',
+ group => '',
+ member => '',
immediate_parent => '',
via => '0',
disabled => '0',
@_
);
- unless ( $args{'Member'}
- && UNIVERSAL::isa( $args{'Member'}, 'RT::Model::Principal' )
- && $args{'Member'}->id )
+ unless ( $args{'member'}
+ && UNIVERSAL::isa( $args{'member'}, 'RT::Model::Principal' )
+ && $args{'member'}->id )
{
Jifty->log->debug("$self->create: bogus Member argument");
}
- unless ( $args{'Group'}
- && UNIVERSAL::isa( $args{'Group'}, 'RT::Model::Principal' )
- && $args{'Group'}->id )
+ unless ( $args{'group'}
+ && UNIVERSAL::isa( $args{'group'}, 'RT::Model::Principal' )
+ && $args{'group'}->id )
{
Jifty->log->debug("$self->create: bogus Group argument");
}
@@ -94,8 +94,8 @@
}
my $id = $self->SUPER::create(
- group_id => $args{'Group'}->id,
- member_id => $args{'Member'}->id,
+ group_id => $args{'group'}->id,
+ member_id => $args{'member'}->id,
immediate_parent_id => $args{'immediate_parent'}->id,
disabled => $args{'disabled'},
via => $args{'via'},
@@ -103,9 +103,9 @@
unless ($id) {
Jifty->log->warn( "Couldn't create "
- . $args{'Member'}
+ . $args{'member'}
. " as a cached member of "
- . $args{'Group'}->id . " via "
+ . $args{'group'}->id . " via "
. $args{'via'} );
return (undef)
; #this will percolate up and bail out of the transaction
@@ -114,23 +114,23 @@
my ( $vid, $vmsg ) = $self->__set( column => 'via', value => $id );
unless ($vid) {
Jifty->log->warn( "Due to a via error, couldn't create "
- . $args{'Member'}
+ . $args{'member'}
. " as a cached member of "
- . $args{'Group'}->id . " via "
+ . $args{'group'}->id . " via "
. $args{'via'} );
return (undef)
; #this will percolate up and bail out of the transaction
}
}
- if ( $args{'Member'}->is_group() ) {
- my $GroupMembers = $args{'Member'}->object->members_obj();
+ if ( $args{'member'}->is_group() ) {
+ my $GroupMembers = $args{'member'}->object->members_obj();
while ( my $member = $GroupMembers->next() ) {
my $cached_member = RT::Model::CachedGroupMember->new;
my $c_id = $cached_member->create(
- Group => $args{'Group'},
- Member => $member->member_obj,
- immediate_parent => $args{'Member'},
+ group => $args{'group'},
+ member => $member->member_obj,
+ immediate_parent => $args{'member'},
disabled => $args{'disabled'},
via => $id
);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Group.pm Thu Jan 31 20:45:56 2008
@@ -209,13 +209,13 @@
my $self = shift;
my %args = (
name => undef,
- User => undef,
+ user => undef,
@_
);
$self->load_by_cols(
"domain" => 'Personal',
- "instance" => $args{'User'},
+ "instance" => $args{'user'},
"type" => '',
"name" => $args{'name'}
);
@@ -412,8 +412,8 @@
# cached members. thankfully, we're creating the group now...so it has no members.
my $cgm = RT::Model::CachedGroupMember->new;
$cgm->create(
- Group => $self->principal_object,
- Member => $self->principal_object,
+ group => $self->principal_object,
+ member => $self->principal_object,
immediate_parent => $self->principal_object
);
@@ -492,8 +492,8 @@
# and so we bypass all sorts of cruft we don't need
my $aclstash = RT::Model::GroupMember->new;
my ( $stash_id, $add_msg ) = $aclstash->_stash_user(
- Group => $self->principal_object,
- Member => $princ
+ group => $self->principal_object,
+ member => $princ
);
unless ($stash_id) {
@@ -983,8 +983,8 @@
my $member_object = RT::Model::GroupMember->new;
my $id = $member_object->create(
- Member => $new_member_obj,
- Group => $self->principal_object,
+ member => $new_member_obj,
+ group => $self->principal_object,
inside_transaction => $args{'inside_transaction'}
);
if ($id) {
@@ -1233,7 +1233,7 @@
my %args = (
column => undef,
value => undef,
- TransactionType => 'Set',
+ transaction_type => 'Set',
record_transaction => 1,
@_
);
@@ -1270,7 +1270,7 @@
if ( $args{'record_transaction'} == 1 ) {
my ( $Trans, $Msg, $TransObj ) = $self->_new_transaction(
- type => $args{'TransactionType'},
+ type => $args{'transaction_type'},
field => $args{'column'},
new_value => $args{'value'},
old_value => $Old,
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMember.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMember.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/GroupMember.pm Thu Jan 31 20:45:56 2008
@@ -55,30 +55,30 @@
sub create {
my $self = shift;
my %args = (
- Group => undef,
- Member => undef,
+ group => undef,
+ member => undef,
inside_transaction => undef,
@_
);
- unless ( $args{'Group'}
- && UNIVERSAL::isa( $args{'Group'}, 'RT::Model::Principal' )
- && $args{'Group'}->id )
+ unless ( $args{'group'}
+ && UNIVERSAL::isa( $args{'group'}, 'RT::Model::Principal' )
+ && $args{'group'}->id )
{
Jifty->log->warn("GroupMember::Create called with a bogus Group arg");
return (undef);
}
- unless ( $args{'Group'}->is_group ) {
+ unless ( $args{'group'}->is_group ) {
Jifty->log->warn(
"Someone tried to add a member to a user instead of a group");
return (undef);
}
- unless ( $args{'Member'}
- && UNIVERSAL::isa( $args{'Member'}, 'RT::Model::Principal' )
- && $args{'Member'}->id )
+ unless ( $args{'member'}
+ && UNIVERSAL::isa( $args{'member'}, 'RT::Model::Principal' )
+ && $args{'member'}->id )
{
Jifty->log->warn(
"GroupMember::Create called with a bogus Principal arg");
@@ -96,20 +96,20 @@
# (and recurse infinitely) Later, we can add code to check this in the
# cache and bail so we can support cycling directed graphs
- if ( $args{'Member'}->is_group ) {
- my $member_object = $args{'Member'}->object;
- if ( $member_object->has_member_recursively( $args{'Group'} ) ) {
+ if ( $args{'member'}->is_group ) {
+ my $member_object = $args{'member'}->object;
+ if ( $member_object->has_member_recursively( $args{'group'} ) ) {
Jifty->log->debug("Adding that group would create a loop");
return (undef);
- } elsif ( $args{'Member'}->id == $args{'Group'}->id ) {
+ } elsif ( $args{'member'}->id == $args{'group'}->id ) {
Jifty->log->debug("Can't add a group to itself");
return (undef);
}
}
my $id = $self->SUPER::create(
- group_id => $args{'Group'}->id,
- member_id => $args{'Member'}->id
+ group_id => $args{'group'}->id,
+ member_id => $args{'member'}->id
);
unless ($id) {
@@ -119,10 +119,10 @@
my $cached_member = RT::Model::CachedGroupMember->new;
my $cached_id = $cached_member->create(
- Member => $args{'Member'},
- Group => $args{'Group'},
- immediate_parent => $args{'Group'},
- Via => '0'
+ member => $args{'member'},
+ group => $args{'group'},
+ immediate_parent => $args{'group'},
+ via => '0'
);
#When adding a member to a group, we need to go back
@@ -132,7 +132,7 @@
# find things which have the current group as a member.
# $group is an RT::Model::Principal for the group.
- $cgm->limit_to_groups_with_member( $args{'Group'}->id );
+ $cgm->limit_to_groups_with_member( $args{'group'}->id );
while ( my $parent_member = $cgm->next ) {
my $parent_id = $parent_member->member_id;
@@ -141,14 +141,14 @@
my $other_cached_member = RT::Model::CachedGroupMember->new;
my $other_cached_id = $other_cached_member->create(
- Member => $args{'Member'},
- Group => $parent_member->group_obj,
+ member => $args{'member'},
+ group => $parent_member->group_obj,
immediate_parent => $parent_member->member_obj,
- Via => $parent_member->id
+ via => $parent_member->id
);
unless ($other_cached_id) {
Jifty->log->err( "Couldn't add "
- . $args{'Member'}
+ . $args{'member'}
. " as a submember of a supergroup" );
Jifty->handle->rollback() unless ( $args{'inside_transaction'} );
return (undef);
@@ -186,8 +186,8 @@
sub _stash_user {
my $self = shift;
my %args = (
- Group => undef,
- Member => undef,
+ group => undef,
+ member => undef,
@_
);
@@ -201,8 +201,8 @@
# cache and bail so we can support cycling directed graphs
my $id = $self->SUPER::create(
- group_id => $args{'Group'}->id,
- member_id => $args{'Member'}->id,
+ group_id => $args{'group'}->id,
+ member_id => $args{'member'}->id,
);
unless ($id) {
@@ -211,10 +211,10 @@
my $cached_member = RT::Model::CachedGroupMember->new;
my $cached_id = $cached_member->create(
- Member => $args{'Member'},
- Group => $args{'Group'},
- immediate_parent => $args{'Group'},
- Via => '0'
+ member => $args{'member'},
+ group => $args{'group'},
+ immediate_parent => $args{'group'},
+ via => '0'
);
unless ($cached_id) {
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CachedGroupMember.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CachedGroupMember.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/CachedGroupMember.pm Thu Jan 31 20:45:56 2008
@@ -69,7 +69,7 @@
# deep memebership
my $objs = RT::Model::CachedGroupMemberCollection->new;
- $objs->limit( column => 'Via', value => $self->id );
+ $objs->limit( column => 'via', value => $self->id );
$objs->limit( column => 'id', operator => '!=', value => $self->id );
push( @$list, $objs );
Modified: rt/branches/3.999-DANGEROUS/t/delegation/cleanup_stalled.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/delegation/cleanup_stalled.t (original)
+++ rt/branches/3.999-DANGEROUS/t/delegation/cleanup_stalled.t Thu Jan 31 20:45:56 2008
@@ -57,7 +57,7 @@
$pg1 = RT::Model::Group->new( current_user => RT->system_user );
( $ret, $msg ) = $pg1->load_personal_group(
name => 'dpg1',
- User => $u1->principal_id
+ user => $u1->principal_id
);
unless ($ret) {
( $ret, $msg ) = $pg1->create_personal_group(
@@ -69,7 +69,7 @@
$pg2 = RT::Model::Group->new( current_user => RT->system_user );
( $ret, $msg ) = $pg2->load_personal_group(
name => 'dpg2',
- User => $u2->principal_id
+ user => $u2->principal_id
);
unless ($ret) {
( $ret, $msg ) = $pg2->create_personal_group(
Modified: rt/branches/3.999-DANGEROUS/t/delegation/revocation.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/delegation/revocation.t (original)
+++ rt/branches/3.999-DANGEROUS/t/delegation/revocation.t Thu Jan 31 20:45:56 2008
@@ -28,7 +28,7 @@
}
$pg1 = RT::Model::Group->new(current_user => RT->system_user);
( $ret, $msg ) = $pg1->load_personal_group( name => 'dpg1',
- User => $u1->principal_id );
+ user => $u1->principal_id );
unless ($ret) {
( $ret, $msg ) = $pg1->create_personal_group( name => 'dpg1',
principal_id => $u1->principal_id );
@@ -36,7 +36,7 @@
ok( $ret, "Load / Create test personal group 1: $msg" );
$pg2 = RT::Model::Group->new(current_user => RT->system_user);
( $ret, $msg ) = $pg2->load_personal_group( name => 'dpg2',
- User => $u1->principal_id );
+ user => $u1->principal_id );
unless ($ret) {
( $ret, $msg ) = $pg2->create_personal_group( name => 'dpg2',
principal_id => $u1->principal_id );
More information about the Rt-commit
mailing list