'create' => array('edit message templates', 'edit user-driven message templates', 'edit system workflow message templates'),
'update' => array('edit message templates', 'edit user-driven message templates', 'edit system workflow message templates'),
);
+
+ $permissions['report_template']['update'] = 'save Report Criteria';
+ $permissions['report_template']['create'] = 'save Report Criteria';
return $permissions;
}
* - general script-add.
*/
public static function getActionMetadata() {
- $actions = array(
- 'report_instance.save' => array('title' => ts('Save')),
- 'report_instance.copy' => array(
+ $actions = array();
+ if (CRM_Core_Permission::check('save Report Criteria')) {
+ $actions['report_instance.save'] = array('title' => ts('Save'));
+ $actions['report_instance.copy'] = array(
'title' => ts('Save a Copy'),
'data' => array(
'is_confirm' => TRUE,
'confirm_title' => ts('Save a copy...'),
'confirm_refresh_fields' => json_encode(array(
- 'title' => array('selector' => '.crm-report-instanceForm-form-block-title', 'prepend' => ts('(Copy) ')),
- 'description' => array('selector' => '.crm-report-instanceForm-form-block-description', 'prepend' => ''),
- 'parent_id' => array('selector' => '.crm-report-instanceForm-form-block-parent_id', 'prepend' => ''),
+ 'title' => array(
+ 'selector' => '.crm-report-instanceForm-form-block-title',
+ 'prepend' => ts('(Copy) '),
+ ),
+ 'description' => array(
+ 'selector' => '.crm-report-instanceForm-form-block-description',
+ 'prepend' => '',
+ ),
+ 'parent_id' => array(
+ 'selector' => '.crm-report-instanceForm-form-block-parent_id',
+ 'prepend' => '',
+ ),
)),
),
- ),
- 'report_instance.print' => array('title' => ts('Print Report')),
- 'report_instance.pdf' => array('title' => ts('Print to PDF')),
- 'report_instance.csv' => array('title' => ts('Export as CSV')),
- );
+ );
+ }
+ $actions['report_instance.print'] = array('title' => ts('Print Report'));
+ $actions['report_instance.pdf'] = array('title' => ts('Print to PDF'));
+ $actions['report_instance.csv'] = array('title' => ts('Export as CSV'));
+
if (CRM_Core_Permission::check('administer Reports')) {
$actions['report_instance.delete'] = array(
'title' => ts('Delete report'),
ts('access Report Criteria'),
ts('Change report search criteria'),
),
+ 'save Report Criteria' => array(
+ ts('save Report Criteria'),
+ ts('Save report search criteria'),
+ ),
'administer private reports' => array(
ts('administer private reports'),
ts('Edit all private reports'),
* an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs.
*/
public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
+ $postUpgradeMessage .= '<p>' . ts('A new %1 permission has been added. It is not granted by default. If your users create reports, you may wish to review your permissions.', array(1 => 'save Report Criteria')) . '</p>';
// Example: Generate a post-upgrade message.
// if ($rev == '5.12.34') {
// $postUpgradeMessage .= '<br /><br />' . ts("By default, CiviCRM now disables the ability to import directly from SQL. To use this feature, you must explicitly grant permission 'import SQL datasource'.");