Answers.Body: <p>I think this is a CMS issue. I see those options available at <a href="http://dmaster.demo.civicrm.org/civicrm/report/instance/18?reset=1&amp;output=criteria" rel="nofollow noreferrer">Drupal Demo</a> but not at <a href="http://wpmaster.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&amp;q=civicrm%2Freport%2Finstance%2F26&amp;reset=1&amp;output=criteria" rel="nofollow noreferrer">WP Demo</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-03T10:39:05.733Z
Answers.Text: doesnt show on joomla either. i find it hard to believe that its a drupal only feature
Answers.UserDisplayName: pok
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-31T04:46:44.717Z
Answers.LastActivityDate: 2017-03-31T04:46:44.717Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>A temporary fix</p>
  
  <p>I have managed to make it appear by modifying the code, though this isnt an ideal solution as updating will probably remove the change.</p>
  
  <p>By replacing this (in instance.php):</p>
  
  <pre><code>if (function_exists('user_roles')) {
          $user_roles_array = user_roles();
          foreach ($user_roles_array as $key =&gt; $value) {
            $user_roles[$value] = $value;
          } // also remove the ending if bracket
  </code></pre>
  
  <p>with this:</p>
  
  <pre><code>$lib = URE_Lib::get_instance();
          $lib-&gt;get_user_roles();
          $user_roles_array = $lib-&gt;get('roles');
          $count = 1;
          foreach ($user_roles_array as $key =&gt; $value) {
            $user_roles[$count] = $key ;
            $count++;
          }
  </code></pre>
  
  <p>the wordpress user roles appear allowing the reports to be restricted based on wordpress roles.</p>
  
  <p>It would be nice to see a proper solution for this.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-04T07:14:44.047Z
Answers.LastActivityDate: 2017-04-04T07:14:44.047Z
Answers.UserDisplayName: pok
Body: <p>I am trying to limit access to reports using acl/groups as mentioned in the userguide :</p>
  
  <p><a href="https://docs.civicrm.org/user/en/4.7/reporting/set-up/#define-report-settings" rel="nofollow noreferrer">https://docs.civicrm.org/user/en/4.7/reporting/set-up/#define-report-settings</a></p>
  
  <p>However, the field to set this does not appear. 
  <a href="https://i.sstatic.net/Aw1b3.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Aw1b3.jpg" alt="access tab for report"></a></p>
  
  <p>Is there something i have to configure to make this appear? Or does this functionality no longer exist?</p>
  
  <p>If relevant I am already using acl for controlling access to custom data sets.</p>
  
  <p>Running civicrm 4.7.17 on wordpress 4.7.3 using php 7.0.15</p>
  
  <p>UPDATE 1:</p>
  
  <p>looking through the code it seems that the following code (found in /wp-content/plugins/civicrm/civicrm/CRM/Report/Form/instance.php) is causing it not to appear:</p>
  
  <pre><code>if (function_exists('user_roles')) {
          $user_roles_array = user_roles();
          foreach ($user_roles_array as $key =&gt; $value) {
            $user_roles[$value] = $value;
          }
          $grouprole = &amp;$form-&gt;addElement('advmultiselect',
            'grouprole',
            ts('ACL Group/Role'),
            $user_roles,
            array(
              'size' =&gt; 5,
              'style' =&gt; 'width:240px',
              'class' =&gt; 'advmultiselect',
            )
          );
          $grouprole-&gt;setButtonAttributes('add', array('value' =&gt; ts('Add &gt;&gt;')));
          $grouprole-&gt;setButtonAttributes('remove', array('value' =&gt; ts('&lt;&lt; Remove')));
        }
  </code></pre>
  
  <p>For some reason the 'user_roles' function does not exist.</p>
  
  <p>So when the below code is run (found in /wp-content/uploads/civicrm/templates_c/en_US/%%48/48E/48E22AAC%%Instance.tpl.php) the php returns nothing:</p>
  
  <pre><code>&lt;tr class="crm-report-instanceForm-form-block-role"&gt;
          &lt;td class="report-label" width="20%"&gt;&lt;?php echo $this-&gt;_tpl_vars['form']['grouprole']['label']; ?&gt;
  &lt;/td&gt;
          &lt;td&gt;&lt;?php echo ((is_array($_tmp=$this-&gt;_tpl_vars['form']['grouprole']['html'])) ? $this-&gt;_run_mod_handler('crmAddClass', true, $_tmp, 'huge') : smarty_modifier_crmAddClass($_tmp, 'huge')); ?&gt;
  &lt;/td&gt;
        &lt;/tr&gt;
  </code></pre>
  
  <p>UPDATE 2:</p>
  
  <p>looking a little higher in instance.php it looks like this might not be for wordpress even though this section still runs:</p>
  
  <pre><code>if ($config-&gt;userFramework != 'Joomla' ||
        $config-&gt;userFramework != 'WordPress'
      ) 
  </code></pre>
  
  <p>still unsure of why 'grouprole' doesnt exist for the other code though:</p>
  
  <pre><code>&lt;tr class="crm-report-instanceForm-form-block-role"&gt;
          &lt;td class="report-label" width="20%"&gt;&lt;?php echo $this-&gt;_tpl_vars['form']['grouprole']['label']; ?&gt;
  &lt;/td&gt;
          &lt;td&gt;&lt;?php echo ((is_array($_tmp=$this-&gt;_tpl_vars['form']['grouprole']['html'])) ? $this-&gt;_run_mod_handler('crmAddClass', true, $_tmp, 'huge') : smarty_modifier_crmAddClass($_tmp, 'huge')); ?&gt;
  &lt;/td&gt;
        &lt;/tr&gt;
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-30T10:02:32.980Z
Comments.Text: It shows on my 4.7.17 so the functionality still exists.  Not sure though why you're not seeing it.
Comments.UserDisplayName: Aidan
Tags: <wordpress><civireport><4.7><acl>
Title: civicrm report access
ThreadText: # civicrm report access
  
  (Asked by: username_0 on 2017-03-30)
  
  I am trying to limit access to reports using acl/groups as mentioned in the userguide :
  
  <https://docs.civicrm.org/user/en/4.7/reporting/set-up/#define-report-settings>
  
  However, the field to set this does not appear.
  [![access tab for report](https://i.sstatic.net/Aw1b3.jpg)](https://i.sstatic.net/Aw1b3.jpg)
  
  Is there something i have to configure to make this appear? Or does this functionality no longer exist?
  
  If relevant I am already using acl for controlling access to custom data sets.
  
  Running civicrm 4.7.17 on wordpress 4.7.3 using php 7.0.15
  
  UPDATE 1:
  
  looking through the code it seems that the following code (found in /wp-content/plugins/civicrm/civicrm/CRM/Report/Form/instance.php) is causing it not to appear:
  
  ```
  if (function_exists('user_roles')) {
          $user_roles_array = user_roles();
          foreach ($user_roles_array as $key => $value) {
            $user_roles[$value] = $value;
          }
          $grouprole = &$form->addElement('advmultiselect',
            'grouprole',
            ts('ACL Group/Role'),
            $user_roles,
            array(
              'size' => 5,
              'style' => 'width:240px',
              'class' => 'advmultiselect',
            )
          );
          $grouprole->setButtonAttributes('add', array('value' => ts('Add >>')));
          $grouprole->setButtonAttributes('remove', array('value' => ts('<< Remove')));
        }
  
  ```
  
  For some reason the 'user\_roles' function does not exist.
  
  So when the below code is run (found in /wp-content/uploads/civicrm/templates\_c/en\_US/%%48/48E/48E22AAC%%Instance.tpl.php) the php returns nothing:
  
  ```
  <tr class="crm-report-instanceForm-form-block-role">
          <td class="report-label" width="20%"><?php echo $this->_tpl_vars['form']['grouprole']['label']; ?>
  </td>
          <td><?php echo ((is_array($_tmp=$this->_tpl_vars['form']['grouprole']['html'])) ? $this->_run_mod_handler('crmAddClass', true, $_tmp, 'huge') : smarty_modifier_crmAddClass($_tmp, 'huge')); ?>
  </td>
        </tr>
  
  ```
  
  UPDATE 2:
  
  looking a little higher in instance.php it looks like this might not be for wordpress even though this section still runs:
  
  ```
  if ($config->userFramework != 'Joomla' ||
        $config->userFramework != 'WordPress'
      ) 
  
  ```
  
  still unsure of why 'grouprole' doesnt exist for the other code though:
  
  ```
  <tr class="crm-report-instanceForm-form-block-role">
          <td class="report-label" width="20%"><?php echo $this->_tpl_vars['form']['grouprole']['label']; ?>
  </td>
          <td><?php echo ((is_array($_tmp=$this->_tpl_vars['form']['grouprole']['html'])) ? $this->_run_mod_handler('crmAddClass', true, $_tmp, 'huge') : smarty_modifier_crmAddClass($_tmp, 'huge')); ?>
  </td>
        </tr>
  
  ```
  
  **Tags:** wordpress, civireport, 4.7, acl
  
  > **Comments:**
  > **username_1**: It shows on my 4.7.17 so the functionality still exists.  Not sure though why you're not seeing it.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-03-31. Score: 1
  
  I think this is a CMS issue. I see those options available at [Drupal Demo](http://dmaster.demo.civicrm.org/civicrm/report/instance/18?reset=1&output=criteria) but not at [WP Demo](http://wpmaster.demo.civicrm.org/wp-admin/admin.php?page=CiviCRM&q=civicrm%2Freport%2Finstance%2F26&reset=1&output=criteria)
  
  > **Comments:**
  > **username_0**: doesnt show on joomla either. i find it hard to believe that its a drupal only feature  
  
  ---
  
  ### Answer by username_0 on 2017-04-04. Score: 1
  
  A temporary fix
  
  I have managed to make it appear by modifying the code, though this isnt an ideal solution as updating will probably remove the change.
  
  By replacing this (in instance.php):
  
  ```
  if (function_exists('user_roles')) {
          $user_roles_array = user_roles();
          foreach ($user_roles_array as $key => $value) {
            $user_roles[$value] = $value;
          } // also remove the ending if bracket
  
  ```
  
  with this:
  
  ```
  $lib = URE_Lib::get_instance();
          $lib->get_user_roles();
          $user_roles_array = $lib->get('roles');
          $count = 1;
          foreach ($user_roles_array as $key => $value) {
            $user_roles[$count] = $key ;
            $count++;
          }
  
  ```
  
  the wordpress user roles appear allowing the reports to be restricted based on wordpress roles.
  
  It would be nice to see a proper solution for this.
  
  
  ---
  
  