limiting agents access to different customers

Moderator: crythias

Locked
bahavar
Znuny newbie
Posts: 11
Joined: 14 Mar 2011, 15:49
Znuny Version: 3.0.4

limiting agents access to different customers

Post by bahavar »

hi all,
i have a few scenarios that i want to implement into my company and i was hoping that i might get some pointers on how to implement them :

1-i want to limit the customers an agent can view to only the specific customers that agent has created.

2-i have a couple of customer back ends and i want to see if i can limit a specific agent to a specific customer back end.

3-also can i force an agent to be able to view and modify only customers in a specific group.

thanks in advance :D
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: limiting agents access to different customers

Post by crythias »

1 - no.

2 - no. (?) Agents are limited to agent themes.

3 - probably not. You can check out customer groups, but if you want to segregate agents and customers, at the minimum you'll be able to assign customers to groups and agents to groups for specific queues that only agent x and customer y belong to group-wise.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
bahavar
Znuny newbie
Posts: 11
Joined: 14 Mar 2011, 15:49
Znuny Version: 3.0.4

Re: limiting agents access to different customers

Post by bahavar »

thanks for you help a few questions though,
for the first scenario i was able to come up with a dirty solution.
by editing the query that is generated when displaying Customers i was able to restrict certain agents to only view the customers that they have created.
in the file Kernel/System/CustomerUser/DB.pm around line 457
i changed
$SQL .= $Self->{CustomerKey} . " FROM $Self->{CustomerTable} WHERE ";
to
$SQL .= $Self->{CustomerKey} . " FROM $Self->{CustomerTable} c inner join (select id from users where login=ONLINEUSER) u on (u.id=c.create_by) WHERE ";

now my question is can anyone tell me how i can get the user that is logged in.

also for the second scenario ill definitely check out agent themes .

Cheers,
daniel_c
Znuny newbie
Posts: 3
Joined: 20 Apr 2010, 06:53
Znuny Version: 2.4.7

Re: limiting agents access to different customers

Post by daniel_c »

Hi,

there is an Feature AddOn[0] available for OTRS Subscription customers - "Restrict Access to Customer Back Ends"[1] which is exactly the thing you need.

Hth,
Daniel

[0] - http://www.otrs.com/solutions/subscript ... e-add-ons/
[1] - http://www.otrs.com/en/solutions/subscr ... erBackEnds
bahavar
Znuny newbie
Posts: 11
Joined: 14 Mar 2011, 15:49
Znuny Version: 3.0.4

Re: limiting agents access to different customers

Post by bahavar »

hi,
thanks daniel this will definitely resolve my problem . :)

Regards,
hmmmm3
Znuny newbie
Posts: 57
Joined: 17 Feb 2012, 07:48
Znuny Version: 3

Re: limiting agents access to different customers

Post by hmmmm3 »

iI ran across this issue and I resolved it using the customeruser/db.pm file, but I edited somewhere around line 247 with the following:

# build SQL string 2/2
# $SQL .= " FROM $Self->{CustomerTable} WHERE ";
$SQL .= " FROM $Self->{CustomerTable} WHERE create_by='".$Param{UserID}."' AND ";

My goal is to only allow the agent that created the customer, the privilege to view the customer.

I had to install the Data::Dumper library from CPAN to find which variable contained the username info. But so far, it appears to work.

Keep in mind I am using version 3.0, so results may vary.
Last edited by hmmmm3 on 29 Nov 2012, 04:52, edited 2 times in total.
hmmmm3
Znuny newbie
Posts: 57
Joined: 17 Feb 2012, 07:48
Znuny Version: 3

Re: limiting agents access to different customers

Post by hmmmm3 »

So I was finally able to achieve this by modifying the following pieces of code:

Keep in mind I am using version 3.0

1.) in System/Customeruser.pm I added a "declaration line"

=item CustomerSearch()

to search users

my %List = $CustomerUserObject->CustomerSearch(
Search => '*some*', # also 'hans+huber' possible
Valid => 1, # not required, default 1
User => 3, //************this line was added
);

my %List = $CustomerUserObject->CustomerSearch(
UserLogin => '*some*',
Valid => 1, # not required, default 1
User => 3, //************this line was added
);

my %List = $CustomerUserObject->CustomerSearch(
PostMasterSearch => 'email@example.com',
Valid => 1, # not required, default 1
User => 3, //************this line was added
);

=cut



2.) in Modules/AdminCustomeruser.pm

I modified the call to CustomerSearch and added the line: User => $Self->{UserID},

The result looks like:

if ( $Param{Search} ) {
my %List = $Self->{CustomerUserObject}->CustomerSearch(
Search => $Param{Search},
Valid => 0,
User => $Self->{UserID},


3.) Then in System/CustomeruSer.DB.pm

I added the following line that I stated in my earlier post.

$SQL .= " FROM $Self->{CustomerTable} WHERE create_by='".$Param{User}."' AND ";


Let me know if you have questions.
Locked