X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FCachedGroupMember_Overlay.pm;h=a292afb7735c68f1b1e31b000564c0b2609c9705;hb=624b2d44625f69d71175c3348cae635d580c890b;hp=15f6bd73d2394b1a51c8f2704870642d0268194c;hpb=9c68254528b6f2c7d8c1921b452fa56064783782;p=freeside.git diff --git a/rt/lib/RT/CachedGroupMember_Overlay.pm b/rt/lib/RT/CachedGroupMember_Overlay.pm index 15f6bd73d..a292afb77 100644 --- a/rt/lib/RT/CachedGroupMember_Overlay.pm +++ b/rt/lib/RT/CachedGroupMember_Overlay.pm @@ -1,8 +1,8 @@ # BEGIN BPS TAGGED BLOCK {{{ # # COPYRIGHT: -# -# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +# +# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 or visit their web page on the internet at +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. # # # CONTRIBUTION SUBMISSION POLICY: @@ -43,6 +45,7 @@ # those contributions and any derivatives thereof. # # END BPS TAGGED BLOCK }}} + package RT::CachedGroupMember; use strict; @@ -146,6 +149,8 @@ sub Create { } } + return $id if $args{'Member'}->id == $args{'Group'}->id; + if ( $args{'Member'}->IsGroup() ) { my $GroupMembers = $args{'Member'}->Object->MembersObj(); while ( my $member = $GroupMembers->Next() ) { @@ -213,7 +218,7 @@ sub Delete { # Unless $self->GroupObj still has the member recursively $self->MemberObj # (Since we deleted the database row above, $self no longer counts) - unless ( $self->GroupObj->Object->HasMemberRecursively( $self->MemberObj ) ) { + unless ( $self->GroupObj->Object->HasMemberRecursively( $self->MemberId ) ) { # Find all ACEs granted to $self->GroupId @@ -258,7 +263,7 @@ sub SetDisabled { my $val = shift; # if it's already disabled, we're good. - return {1} if ($self->__Value('Disabled') == $val); + return (1) if ( $self->__Value('Disabled') == $val); my $err = $self->SUPER::SetDisabled($val); my ($retval, $msg) = $err->as_array(); unless ($retval) { @@ -284,7 +289,7 @@ sub SetDisabled { # Unless $self->GroupObj still has the member recursively $self->MemberObj # (Since we SetDisabledd the database row above, $self no longer counts) - unless ( $self->GroupObj->Object->HasMemberRecursively( $self->MemberObj ) ) { + unless ( $self->GroupObj->Object->HasMemberRecursively( $self->MemberId ) ) { # Find all ACEs granted to $self->GroupId my $acl = RT::ACL->new($RT::SystemUser); $acl->LimitToPrincipal( Id => $self->GroupId );