summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/access_user.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm
index 874da66..ca0bcd6 100644
--- a/FS/FS/access_user.pm
+++ b/FS/FS/access_user.pm
@@ -298,12 +298,13 @@ Returns an sql fragement to select only agentnums this user can view.
sub agentnums_sql {
my $self = shift;
- my @agentnums = $self->agentnums;
- return ' 1 = 0 ' unless scalar(@agentnums);
+ my @agentnums = map { "agentnum = $_" } $self->agentnums;
+
+ push @agentnums, 'agentnum IS NULL'
+ if $self->access_right('View/link unlinked services');
- '( '.
- join( ' OR ', map "agentnum = $_", @agentnums ).
- ' )';
+ return ' 1 = 0 ' unless scalar(@agentnums);
+ '( '. join( ' OR ', @agentnums ). ' )';
}
=item agentnum