projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rt 4.0.23
[freeside.git]
/
rt
/
lib
/
RT
/
Groups.pm
diff --git
a/rt/lib/RT/Groups.pm
b/rt/lib/RT/Groups.pm
index
c234858
..
576c99d
100755
(executable)
--- a/
rt/lib/RT/Groups.pm
+++ b/
rt/lib/RT/Groups.pm
@@
-2,7
+2,7
@@
#
# COPYRIGHT:
#
#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-201
4
Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-201
5
Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
@@
-240,6
+240,15
@@
sub WithMember {
return $members;
}
return $members;
}
+sub WithCurrentUser {
+ my $self = shift;
+ $self->{with_current_user} = 1;
+ return $self->WithMember(
+ PrincipalId => $self->CurrentUser->PrincipalId,
+ Recursively => 1,
+ );
+}
+
sub WithoutMember {
my $self = shift;
my %args = (
sub WithoutMember {
my $self = shift;
my %args = (
@@
-427,22
+436,16
@@
sub LimitToDeleted {
-sub
Next
{
+sub
AddRecord
{
my $self = shift;
my $self = shift;
+ my ($record) = @_;
- # Don't show groups which the user isn't allowed to see.
+ # If we've explicitly limited to groups the user is a member of (for
+ # dashboard or savedsearch privacy objects), skip the ACL.
+ return unless $self->{with_current_user}
+ or $record->CurrentUserHasRight('SeeGroup');
- my $Group = $self->SUPER::Next();
- if ((defined($Group)) and (ref($Group))) {
- unless ($Group->CurrentUserHasRight('SeeGroup')) {
- return $self->Next();
- }
-
- return $Group;
- }
- else {
- return undef;
- }
+ return $self->SUPER::AddRecord( $record );
}
}