# Assign Teams to kreports

**URL:** <https://community.spicecrm.io/t/assign-teams-to-kreports/77>\
**Category:** KReporter\
**Created:** [February 16, 2017, 9:47pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77 "2017-02-16T21:47:38Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![maryrsch](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@maryrsch](https://community.spicecrm.io/u/maryrsch)\
**Post date:** [February 16, 2017, 9:47pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/1 "2017-02-16T21:47:38Z")

</div>

Hello,

I am using the free version of kreporter 3.1 I want to assign reports to a team, I installed Security Suite, but this does not work with this version of Kreporter, could you please advice me a plugin or tell how can I do it?

Thank you for your help

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [February 20, 2017, 8:59am UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/2 "2017-02-20T08:59:29Z")

</div>

Hi Mary, please set $sugar\_config[‘KReports’][‘authCheck’] = ‘SecurityGroups’; in your config\_override.php located at the root of your sugarcrm installation.  
In KReport edit view you will then see a new dropdown for Team Allocation. Im my example I created a SecurityGroup “Support”

 ![](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/a22b4c3fefbecbe8ee37fbc31d0f83457d8c673e.PNG)

---

<div class="post-metadata">

**Author:** ![maryrsch](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@maryrsch](https://community.spicecrm.io/u/maryrsch)\
**Post date:** [February 20, 2017, 7:15pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/3 "2017-02-20T19:15:01Z")

</div>

Thanks.  
“$sugar\_config[‘KReports’][‘authCheck’] = ‘SecurityGroups’;” It’s ready.

Now, when I open my Kreporter, I can’t create or edit any report.  
The page it’s only blank.  
Can you help me please?

 ![](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/17caa51860da31730c306a213d3ccae3f01df842.PNG)

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [February 20, 2017, 7:32pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/4 "2017-02-20T19:32:28Z")

</div>

Mary, you probably run into a php error. Please check your php error log. I guess there is a code modification needed in modules/KReports/views/view.edit.php on line 33: add $db to global access in display function:

```
function display() {
      global $app_list_strings, $mod_strings, $current_language, $dictionary, $sugar_config,$db;

      // ann Add Js Strinf that will be assigned at the end befor ehte view gets rendered
      $this->addJsString = '';
      $jsVariables = '';
```

---

<div class="post-metadata">

**Author:** ![maryrsch](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@maryrsch](https://community.spicecrm.io/u/maryrsch)\
**Post date:** [February 20, 2017, 8:29pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/6 "2017-02-20T20:29:58Z")

</div>

It’s done!  
Thanks for all.

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://community.spicecrm.io/u/Pat)\
**Post date:** [February 6, 2018, 5:33pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/7 "2018-02-06T17:33:01Z")

</div>

Hi,

Is it possible to assign one report to more than one security group? In the dropdown that appears with the label LBL\_ASSIGNED\_SECURITYGROUP\_LABEL I can only select one security group.  
I can assign the report to more then one security group via the Security groups subpanel that appears in the detail view of the report, but if i edit the report, when I click the _Save_ button the security groups are deleted from the report.

Thanks in advance,

Pat

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [February 7, 2018, 5:46am UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/8 "2018-02-07T05:46:51Z")

</div>

Hi Pat,  
Only single assignment is possible in KReport itself.  
Val

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://community.spicecrm.io/u/Pat)\
**Post date:** [February 7, 2018, 9:03am UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/9 "2018-02-07T09:03:39Z")

</div>

Thanls fpr your reply, Val. Is there any way of making kreport ignore the dropdown LBL\_ASSIGNED\_SECURITYGROUP\_LABEL and not deleting the multiple assigned security groups (assigned via the subpanel) when editing a report?

Thanks in advance,

Pat

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [February 7, 2018, 11:59am UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/10 "2018-02-07T11:59:29Z")

</div>

Pat,

you will have to comment the part of the code deleting entries:  
modules/KReports/KReport.php  
function save()  
after parent::save  
you will find a switch block:

```
switch ($sugar_config['KReports']['authCheck']) {
            case 'SecurityGroups':
                $this->db->query("DELETE FROM securitygroups_records WHERE record_id = '" . $this->id . "'");
                $this->db->query("INSERT INTO securitygroups_records (id, securitygroup_id, record_id, module, modified_user_id, created_by, deleted) values ('" . create_guid() . "', '" . $_REQUEST['authaccess_id'] . "', '" . $this->id . "', 'KReports', '" . $GLOBALS['current_user']->id . "', '" . $GLOBALS['current_user']->id . "', 0)");
                break;
        }

```

Comment the whole block.

Val

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://community.spicecrm.io/u/Pat)\
**Post date:** [February 8, 2018, 4:51pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/11 "2018-02-08T16:51:07Z")

</div>

Hi Val,

I have commented that part and effectively now I can assign multiple security groups to the same report via the subpanel in the detail view, and editing the report doesn’t delete the assigned groups.

Just one question more: the only purpose of that part of code was to save the group assigned via the LBL\_ASSIGNED\_SECURITYGROUP\_LABEL dropdown, replacing the ones assigned before?

Thank you very much!

Pat

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [February 8, 2018, 5:07pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/12 "2018-02-08T17:07:27Z")

</div>

Yes Pat,  
that’s what it does. Delete current assigned security groups and insert the one selected in LBL\_ASSIGNED\_SECURITYGROUP\_LABEL dropdown.

Val

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://community.spicecrm.io/u/Pat)\
**Post date:** [February 8, 2018, 5:22pm UTC](https://community.spicecrm.io/t/assign-teams-to-kreports/77/13 "2018-02-08T17:22:21Z")

</div>

Ok Val, perfect. Thank you very much for your support!!! 🙂

Pat
