Issue regarding user groups and allowed campaigns

Discussions about new features or changes in existing features

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Issue regarding user groups and allowed campaigns

Postby DomeDan » Mon Oct 22, 2012 4:27 am

Hello,
I just noticed a problem with user groups and allowed campaigns, Here is my setup:

User group: SUPERVISOR
allowed campaigns:
* foo
* bar

User group: AGENTS_20
allowed campaigns:
* baz

The supervisor wants a clean campaign list so he don't want to see the campaign baz and a few others, but AGENTS_20 needs that campaign.

The problem occurs when the supervisor goes in to the AGENTS_20 group and edit anything,
then the campaign baz will be removed from allowed campaigns because it will not appear on the pages for the supervisor.

Before I start to edit the code to make this work I would like to hear from you people,
my approach would be to compare current AGENTS_20 allowed campaigns with SUPERVISORs allowed campaigns
if there is campaings on AGENTS_20 that are not in SUPERVISORs then add them to the update query.

Whats your thoughts on this?

Admin BUILD: 120831-1523
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Issue regarding user groups and allowed campaigns

Postby williamconley » Mon Oct 22, 2012 6:48 pm

you lost me completely here:

The problem occurs when the supervisor goes in to the AGENTS_20 group and edit anything,
then the campaign baz will be removed from allowed campaigns because it will not appear on the pages for the supervisor.

what exactly did he edit that caused the campaign to be removed?
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Issue regarding user groups and allowed campaigns

Postby DomeDan » Tue Oct 23, 2012 4:23 am

The supervisor don't really need to edit anything, just pressing Submit will cause the campaign to be removed.

Ok, so imagine this scenario
The supervisor wants to add foo to AGENTS_20 allowed campaigns
He looks at the user groups admin pages and sees this:
[_] foo
[_] bar
no allowed campaigns (and that's what it should look like because the supervisor is not allowed too see baz)
but in reality this is the case:
Code: Select all
mysql> SELECT allowed_campaigns FROM asterisk.vicidial_user_groups WHERE user_group = 'AGENTS_20';
+-------------------+
| allowed_campaigns |
+-------------------+
| baz -             |
+-------------------+

He goes on and adds foo
[x] foo
[_] bar
and presses submit, to the supervisor this looks all OK, but taking a look at the database again and we will see this:
Code: Select all
mysql> SELECT allowed_campaigns FROM asterisk.vicidial_user_groups WHERE user_group = 'AGENTS_20';
+-------------------+
| allowed_campaigns |
+-------------------+
| foo -             |
+-------------------+

The campaign baz is removed from allowed campaigns


So this problem occurs when a user group that edits other user groups are not allowed to see the campaigns that the edited user group is allowed to see.
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Issue regarding user groups and allowed campaigns

Postby mflorell » Tue Oct 23, 2012 5:52 am

Please post this to the issue tracker.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Issue regarding user groups and allowed campaigns

Postby DomeDan » Tue Oct 23, 2012 6:21 am

I sure can,
but I wanted to hear some feedback first, the issue tracker has been a bit quite lately, I guess its because you had a lot to do and no one else applies patches.

And when I post to the issue tracker I rather post a fix because I know this can be fixed,
but I'm not sure yet what the best way to do it would be
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Issue regarding user groups and allowed campaigns

Postby mflorell » Wed Oct 24, 2012 6:08 am

I would guess that the User Group modify submission section would need to take the former permissions and compare them to the permissions of the Manager, and if there are any differences that were selected, those should be left in when the record is edited. It's not too complex, it would just take an hour or three to write and test.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Issue regarding user groups and allowed campaigns

Postby DomeDan » Thu Oct 25, 2012 8:54 am

Yeah, that's the solution I had in mind.
I wrote the code needed to solve this problem and posted it on the issue tracker http://www.vicidial.org/VICIDIALmantis/view.php?id=615
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: Issue regarding user groups and allowed campaigns

Postby mflorell » Thu Oct 25, 2012 2:04 pm

Thank you very much, when I get back from Astricon I'll should have some time to take a look at it.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Features

Who is online

Users browsing this forum: No registered users and 17 guests