diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-08-15 23:12:58 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-08-15 23:12:58 -0700 |
commit | 66b55857d43110136cf85d57dbda0960cad29b32 (patch) | |
tree | d209d5f53f3892a6fe852585dd77c62890aca73a /FS/FS/cust_main.pm | |
parent | b8d26f05c2add703389f9391a8375d7dcb800865 (diff) |
separate ACL for merging customers across agents, RT#18939
Diffstat (limited to 'FS/FS/cust_main.pm')
-rw-r--r-- | FS/FS/cust_main.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 3742bfdad..fda82e45b 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1245,9 +1245,12 @@ sub merge { return "Can't merge a customer into self" if $self->custnum == $new_custnum; - unless ( qsearchs( 'cust_main', { 'custnum' => $new_custnum } ) ) { - return "Invalid new customer number: $new_custnum"; - } + my $new_cust_main = qsearchs( 'cust_main', { 'custnum' => $new_custnum } ) + or return "Invalid new customer number: $new_custnum"; + + return 'Access denied: "Merge customer across agents" access right required to merge into a customer of a different agent' + if $self->agentnum != $new_cust_main->agentnum + && ! $FS::CurrentUser::CurrentUser->access_right('Merge customer across agents'); local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; |