[Rt-commit] rt branch, master, updated. rt-4.0.8-630-gc061c0f

Thomas Sibley trs at bestpractical.com
Thu Nov 29 19:57:58 EST 2012


The branch, master has been updated
       via  c061c0f7afec05a727face09364f6b1976256dca (commit)
       via  fbcc9b22b08e18dc15b42c96a791941f3e1ec145 (commit)
       via  3ae488e2e5ffc6b63251ba0dc59ce4a48b23f71f (commit)
       via  3911c5d5d3874909900e0da0fb6279999520f5de (commit)
       via  b2f9621315350024f0fe857b54456b2b77348924 (commit)
       via  2dd85d92bd304177ec911d684bd427efee6f020b (commit)
       via  cca1e724d94e02515e70e03bccb3e8cb5a2bde59 (commit)
       via  41806d64531269557f4b8ff86fccacfe83b79d13 (commit)
       via  e5dc532b411bc3e5516238f45f6c1a6c80d24895 (commit)
       via  b5b41c3f0b6ce0bf68f912dc86ac88317557fd83 (commit)
       via  656b955e82574247c8e4c12df3e9894ff71555db (commit)
       via  4fab867b656225d9aede25e63e801ae890429d78 (commit)
       via  d2be0827d2619585b1a8cdbaabd69a3ebeaedde2 (commit)
       via  dd7fbf03f5bd890cde6e90f83b07a30de13d2213 (commit)
       via  89be28f4395493952d4b73b026a2f1946a14fe82 (commit)
       via  6c0e66896053ea108adae6ac7853557b24d8d2c7 (commit)
       via  71d118b7c4f110560dd4c6d2f08e0638e581e285 (commit)
       via  dde7d91700593e60f7ece620e095e37c3b8933bb (commit)
       via  d659343c0e6bbba26c116735ac185f88d3f02f5f (commit)
       via  42febb092c5ae2fdc40327b63806146c16fd5440 (commit)
       via  eaec506de29d8ef19b76b940a49c627cbc137121 (commit)
       via  4ceffb95dc789d350c285d01d1d0f2092021cd8f (commit)
       via  07e7ce98c0132ea810c0abb81c36105fa001cde7 (commit)
       via  d8b7270f7a5a7aecc04335d0a668a62fa9ac82cc (commit)
       via  77dbbcbdc1cda601c7443cbd0324983520b4d424 (commit)
       via  fb5df38c7e15393bac386aa5e2b9fc2f77b65fc0 (commit)
       via  72524ea21892c6d6dd39816581bd30448573d42a (commit)
       via  c5e48f46f3f8059c2a2de9d7832147516adb3d89 (commit)
       via  7663a52c6b131ff0d4bf779782f94b8e94022ac5 (commit)
       via  13f7c1e22f14b12c51765c0568c4dffa96fe050f (commit)
       via  f54a4abb564937873d825b423f00fa9a47ffd608 (commit)
       via  fbb087d0817a843b9572d5b53188e511eed4ed6b (commit)
       via  123bf570efc47bd71c1b2f1479cb2139dc928068 (commit)
       via  270353574bccbf9814dac3963b9c133a27138f1f (commit)
       via  d58e81c285c210df881cdfd43f18e42d4be47a40 (commit)
       via  9b8b2fa00b393ff784beb8276f6373749df9671e (commit)
       via  ffb6551681204b60aa855a923d6df8bfc1f23644 (commit)
       via  7e6af1c7b544c40f8c31b28566b76f0552d2aabb (commit)
       via  43101c2b5150fb953ade085136b9ba982d3d42f3 (commit)
       via  5ae3701a5b7c1c16f2731ef2050b0b829b234b6e (commit)
       via  d3ba587f414adfa844da27a0ef621e63628f84c5 (commit)
      from  dffb067208d98b7063cece4d02c0fc22f22497b8 (commit)

Summary of changes:
 etc/upgrade/4.1.4/content                        |  49 +++
 etc/upgrade/4.1.4/schema.Oracle                  |   1 +
 etc/upgrade/4.1.4/schema.Pg                      |   1 +
 etc/upgrade/4.1.4/schema.SQLite                  |   1 +
 etc/upgrade/4.1.4/schema.mysql                   |   1 +
 lib/RT/ACE.pm                                    |  18 +-
 lib/RT/Group.pm                                  | 368 +++++++++++++++------
 lib/RT/Groups.pm                                 |  28 +-
 lib/RT/Handle.pm                                 |  19 +-
 lib/RT/Interface/Web.pm                          |  12 +-
 lib/RT/Principal.pm                              |  18 +-
 lib/RT/Queue.pm                                  | 119 +++----
 lib/RT/Record.pm                                 | 344 ++++++++++++++++++++
 lib/RT/Shredder/GroupMember.pm                   |   8 -
 lib/RT/Shredder/Plugin/Summary.pm                |   2 +-
 lib/RT/System.pm                                 |  40 ++-
 lib/RT/Test.pm                                   |  14 +-
 lib/RT/Ticket.pm                                 | 396 ++++++-----------------
 lib/RT/Users.pm                                  |   5 +-
 sbin/rt-test-dependencies.in                     |   1 +
 share/html/Admin/Elements/EditRightsCategoryTabs |   7 +-
 t/api/groups.t                                   |   3 +-
 t/api/queue.t                                    |  12 +-
 t/api/rights.t                                   |  12 +-
 t/api/system-available-rights.t                  |  65 ++++
 t/api/ticket.t                                   |  15 +-
 t/customfields/access_via_queue.t                |   7 +-
 t/mail/gateway.t                                 |   6 +-
 t/ticket/deferred_owner.t                        |  21 +-
 29 files changed, 999 insertions(+), 594 deletions(-)
 create mode 100644 etc/upgrade/4.1.4/content
 create mode 100644 etc/upgrade/4.1.4/schema.Oracle
 create mode 100644 etc/upgrade/4.1.4/schema.Pg
 create mode 100644 etc/upgrade/4.1.4/schema.SQLite
 create mode 100644 etc/upgrade/4.1.4/schema.mysql
 create mode 100644 t/api/system-available-rights.t

- Log -----------------------------------------------------------------
commit c061c0f7afec05a727face09364f6b1976256dca
Merge: dffb067 fbcc9b2
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Nov 29 16:51:54 2012 -0800

    Merge branch '4.2/extensible-roles'
    
    Conflicts:
    	lib/RT/Ticket.pm
            ->Import was removed on master

diff --cc lib/RT/Ticket.pm
index 45bcffc,ca6745d..ecb0f93
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@@ -733,41 -652,196 +652,7 @@@ sub _Parse822HeadersForAttributes 
  }
  
  
- =head2 _CreateTicketGroups
- 
- Create the ticket groups and links for this ticket. 
- This routine expects to be called from Ticket->Create _inside of a transaction_
- 
- It will create four groups for this ticket: Requestor, Cc, AdminCc and Owner.
- 
- It will return true on success and undef on failure.
- 
- 
- =cut
- 
- 
- sub _CreateTicketGroups {
-     my $self = shift;
-     
-     my @types = (qw(Requestor Owner Cc AdminCc));
- 
-     foreach my $type (@types) {
-         my $type_obj = RT::Group->new($self->CurrentUser);
-         my ($id, $msg) = $type_obj->CreateRoleGroup(Domain => 'RT::Ticket-Role',
-                                                        Instance => $self->Id, 
-                                                        Type => $type);
-         unless ($id) {
-             $RT::Logger->error("Couldn't create a ticket group of type '$type' for ticket ".
-                                $self->Id.": ".$msg);     
-             return(undef);
-         }
-      }
-     return(1);
-     
- }
- 
- 
  
 -=head2 Import PARAMHASH
 -
 -Import a ticket. 
 -Doesn\'t create a transaction. 
 -Doesn\'t supply queue defaults, etc.
 -
 -Returns: TICKETID
 -
 -=cut
 -
 -sub Import {
 -    my $self = shift;
 -    my ( $ErrStr, $QueueObj, $Owner );
 -
 -    my %args = (
 -        id              => undef,
 -        EffectiveId     => undef,
 -        Queue           => undef,
 -        Requestor       => undef,
 -        Type            => 'ticket',
 -        Owner           => RT->Nobody->Id,
 -        Subject         => '[no subject]',
 -        InitialPriority => undef,
 -        FinalPriority   => undef,
 -        Status          => 'new',
 -        TimeWorked      => "0",
 -        Due             => undef,
 -        Created         => undef,
 -        Updated         => undef,
 -        Resolved        => undef,
 -        Told            => undef,
 -        @_
 -    );
 -
 -    if ( ( defined( $args{'Queue'} ) ) && ( !ref( $args{'Queue'} ) ) ) {
 -        $QueueObj = RT::Queue->new(RT->SystemUser);
 -        $QueueObj->Load( $args{'Queue'} );
 -
 -        #TODO error check this and return 0 if it\'s not loading properly +++
 -    }
 -    elsif ( ref( $args{'Queue'} ) eq 'RT::Queue' ) {
 -        $QueueObj = RT::Queue->new(RT->SystemUser);
 -        $QueueObj->Load( $args{'Queue'}->Id );
 -    }
 -    else {
 -        $RT::Logger->debug(
 -            "$self " . $args{'Queue'} . " not a recognised queue object." );
 -    }
 -
 -    #Can't create a ticket without a queue.
 -    unless ( defined($QueueObj) and $QueueObj->Id ) {
 -        $RT::Logger->debug("$self No queue given for ticket creation.");
 -        return ( 0, $self->loc('Could not create ticket. Queue not set') );
 -    }
 -
 -    #Now that we have a queue, Check the ACLS
 -    unless (
 -        $self->CurrentUser->HasRight(
 -            Right    => 'CreateTicket',
 -            Object => $QueueObj
 -        )
 -      )
 -    {
 -        return ( 0,
 -            $self->loc("No permission to create tickets in the queue '[_1]'"
 -              , $QueueObj->Name));
 -    }
 -
 -    # Deal with setting the owner
 -
 -    # Attempt to take user object, user name or user id.
 -    # Assign to nobody if lookup fails.
 -    if ( defined( $args{'Owner'} ) ) {
 -        if ( ref( $args{'Owner'} ) ) {
 -            $Owner = $args{'Owner'};
 -        }
 -        else {
 -            $Owner = RT::User->new( $self->CurrentUser );
 -            $Owner->Load( $args{'Owner'} );
 -            if ( !defined( $Owner->id ) ) {
 -                $Owner->Load( RT->Nobody->id );
 -            }
 -        }
 -    }
 -
 -    #If we have a proposed owner and they don't have the right 
 -    #to own a ticket, scream about it and make them not the owner
 -    if (
 -        ( defined($Owner) )
 -        and ( $Owner->Id != RT->Nobody->Id )
 -        and (
 -            !$Owner->HasRight(
 -                Object => $QueueObj,
 -                Right    => 'OwnTicket'
 -            )
 -        )
 -      )
 -    {
 -
 -        $RT::Logger->warning( "$self user "
 -              . $Owner->Name . "("
 -              . $Owner->id
 -              . ") was proposed "
 -              . "as a ticket owner but has no rights to own "
 -              . "tickets in '"
 -              . $QueueObj->Name . "'" );
 -
 -        $Owner = undef;
 -    }
 -
 -    #If we haven't been handed a valid owner, make it nobody.
 -    unless ( defined($Owner) ) {
 -        $Owner = RT::User->new( $self->CurrentUser );
 -        $Owner->Load( RT->Nobody->UserObj->Id );
 -    }
 -
 -    unless ( $self->ValidateStatus( $args{'Status'} ) ) {
 -        return ( 0, $self->loc("'[_1]' is an invalid value for status", $args{'Status'}) );
 -    }
 -
 -    $self->{'_AccessibleCache'}{Created}       = { 'read' => 1, 'write' => 1 };
 -    $self->{'_AccessibleCache'}{Creator}       = { 'read' => 1, 'auto'  => 1 };
 -    $self->{'_AccessibleCache'}{LastUpdated}   = { 'read' => 1, 'write' => 1 };
 -    $self->{'_AccessibleCache'}{LastUpdatedBy} = { 'read' => 1, 'auto'  => 1 };
 -
 -    # If we're coming in with an id, set that now.
 -    my $EffectiveId = undef;
 -    if ( $args{'id'} ) {
 -        $EffectiveId = $args{'id'};
 -
 -    }
 -
 -    my $id = $self->SUPER::Create(
 -        id              => $args{'id'},
 -        EffectiveId     => $EffectiveId,
 -        Queue           => $QueueObj->Id,
 -        Owner           => $Owner->Id,
 -        Subject         => $args{'Subject'},        # loc
 -        InitialPriority => $args{'InitialPriority'},    # loc
 -        FinalPriority   => $args{'FinalPriority'},    # loc
 -        Priority        => $args{'InitialPriority'},    # loc
 -        Status          => $args{'Status'},        # loc
 -        TimeWorked      => $args{'TimeWorked'},        # loc
 -        Type            => $args{'Type'},        # loc
 -        Created         => $args{'Created'},        # loc
 -        Told            => $args{'Told'},        # loc
 -        LastUpdated     => $args{'Updated'},        # loc
 -        Resolved        => $args{'Resolved'},        # loc
 -        Due             => $args{'Due'},        # loc
 -    );
 -
 -    # If the ticket didn't have an id
 -    # Set the ticket's effective ID now that we've created it.
 -    if ( $args{'id'} ) {
 -        $self->Load( $args{'id'} );
 -    }
 -    else {
 -        my ( $val, $msg ) =
 -          $self->__Set( Field => 'EffectiveId', Value => $id );
 -
 -        unless ($val) {
 -            $RT::Logger->err(
 -                $self . "->Import couldn't set EffectiveId: $msg" );
 -        }
 -    }
 -
 -    my $create_groups_ret = $self->_CreateTicketGroups();
 -    unless ($create_groups_ret) {
 -        $RT::Logger->crit(
 -            "Couldn't create ticket groups for ticket " . $self->Id );
 -    }
 -
 -    $self->OwnerGroup->_AddMember( PrincipalId => $Owner->PrincipalId );
 -
 -    foreach my $watcher ( @{ $args{'Cc'} } ) {
 -        $self->_AddWatcher( Type => 'Cc', Email => $watcher, Silent => 1 );
 -    }
 -    foreach my $watcher ( @{ $args{'AdminCc'} } ) {
 -        $self->_AddWatcher( Type => 'AdminCc', Email => $watcher,
 -            Silent => 1 );
 -    }
 -    foreach my $watcher ( @{ $args{'Requestor'} } ) {
 -        $self->_AddWatcher( Type => 'Requestor', Email => $watcher,
 -            Silent => 1 );
 -    }
 -
 -    return ( $self->Id, $ErrStr );
 -}
 -
  =head2 OwnerGroup
  
  A constructor which returns an RT::Group object containing the owner of this ticket.

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


More information about the Rt-commit mailing list