Author Topic: Change persmission for 'Find and Merge Duplicate Contacts'  (Read 6537 times)

Offline petbos157

  • I’m new here
  • *
  • Posts: 26
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7
  • MySQL version: 5.1.71
  • PHP version: 5.3.3
Change persmission for 'Find and Merge Duplicate Contacts'
« on: January 12, 2010, 05:02:31 am »
Hi,

We work with users with different kinds roles.(look at the image i attached to this topic)
We use 2 roles (crmmanagers en crmusers).
How can a give these role the permission to 'Find and Merge Duplicate Contacts' and correct the results, without given these role the 'administer CiviCRM' permission.
Because we don't want that these roles can control the configuration. This is only for the administrator.

Can somebody help me on this ?
« Last Edit: January 12, 2010, 05:51:46 am by petbos157 »

Offline Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #1 on: January 12, 2010, 08:09:03 am »

you will need to change the menu config and move the merge url out of the administration screen and into a crmuser related screen

one option might be to create another url which basically invokes the same function. The main issue would be, the merge screen calls urls below that to actually merge the records which will also need to be repermissioned.

ping us on IRC and we can figure out some potential solutions

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Offline petbos157

  • I’m new here
  • *
  • Posts: 26
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7
  • MySQL version: 5.1.71
  • PHP version: 5.3.3
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #2 on: January 14, 2010, 01:19:44 pm »
I'm glad to hear its possible. But with the little explanation you give me didn't bring me much further.
Are there anywhere examples to do this.
I've tried to change the admin.xml files into de CRM/core/xml/menu.
Extract the  deduperules and dedupefind menu items and put it into the contact.xml file.
And changed the callback in the xml file from 'CRM_Admin_Page_DedupeRules' to 'CRM_Contact_Page_DedupeRules'
And moved the DedupeRules.php and Dedupefind.php from the CRM/Admin directory to CRM/Contact directory.
All this didn't help me much, when i call the URL http://localhost/cms/index.php?q=civicrm/contact/deduperules&reset=1. I does do nothing and i don't get any error-message.
I'm a little stuck on this

Offline Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #3 on: January 14, 2010, 03:42:46 pm »

lets discuss this on IRC might be easiest and faster :)

a few things:

1. moving files around is not a good idea, IMO :)

2. class names and file names are related, so if u disregard 1, u need to edit the file and fix the classname

3. check apache error log if u get a blank screen

4. i've not done this before, so cant be too specific but just a broad outline of how i would potentially approach it

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Offline petbos157

  • I’m new here
  • *
  • Posts: 26
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7
  • MySQL version: 5.1.71
  • PHP version: 5.3.3
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #4 on: January 15, 2010, 07:03:01 am »
How can i reach you through IRC

Offline Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #5 on: January 15, 2010, 07:15:17 am »

would help if you did a search before posting :) "irc civicrm" gives you good links on google

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Offline petbos157

  • I’m new here
  • *
  • Posts: 26
  • Karma: 2
  • CiviCRM version: 4.4.3
  • CMS version: Drupal 7
  • MySQL version: 5.1.71
  • PHP version: 5.3.3
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #6 on: January 15, 2010, 03:28:54 pm »
It works !!!  How ? Well...

1) Edit the admin.xml and add the next line in the deduperules and dedupefind item
     <access_arguments>access CiviCRM</access_arguments>
    Remark :  If you don't want that non-admin users can change the rules, do not add previous line in the
                 deduperules item. And change 'civicrm/admin/deduperules' into 'civicrm/admin/dedupefind' in the
                 following line in 'DedupeFind.php' :

                 $session->setStatus("No possible duplicates were found using {$ruleGroup->name} rule.");
                 $url = CRM_Utils_System::url('civicrm/admin/dedupefind', "reset=1");

2) Edit the contact.xml and add the next line in the merge item
     <access_arguments>access CiviCRM</access_arguments>

3) Edit the merge.php file (CRM/contact/form) and change the following line
        if ( ! CRM_Core_Permission::check( 'administer CiviCRM' ) ) {
into
        if ( ! CRM_Core_Permission::check( 'access CiviCRM' ) ) {

4) Rebuild the CRM-menu's
        Clear menu-table -> Empty the 'civicrm_menu' table in the mysql civicrm database
        Rebuild menu -> http://www.yourdomain/?q=civicrm/menu/rebuild?reset=1

5) Rebuild the permissions with this URL
        http://www.yourdomain/?q=admin/content/node-settings/rebuild

Now you can create custom-menuitems for your users. Then they can check and merge duplicate contacts without the 'administer CiviCRM' permission.
Thanks to all for helping me out.

Cheers.


« Last Edit: January 18, 2010, 04:23:37 am by petbos157 »

Offline TwoMice

  • I post frequently
  • ***
  • Posts: 213
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #7 on: May 26, 2010, 09:35:12 pm »
I'm in the same boat as the OP, but it would be nice to avoid making so many changes/overrides to core.  Maybe this is the only way right now (unless someone has a better suggestion).

For future releases, would it be worth considering a CRM-level permission for "merge contacts"?  Or, is it wrong-headed to think that "delete contacts" should include merge privileges?

- Allen
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Offline TwoMice

  • I post frequently
  • ***
  • Posts: 213
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #8 on: June 03, 2010, 08:01:44 am »
I've added a blog post outlining ideas for getting this into core: http://civicrm.org/blogs/allenshaw/allowing-non-admins-find-and-merge-duplicates

There are some issues regarding ACLs, and possibly other headaches I haven't thought of.  Please comment on that blog post if you have some input.

Thanks to petbos157 for the initial ideas.

- Allen
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Offline TwoMice

  • I post frequently
  • ***
  • Posts: 213
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #9 on: June 04, 2010, 03:54:03 pm »
FYI, I've added a support ticket for this feature:
http://issues.civicrm.org/jira/browse/CRM-6330
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

Offline websynapse

  • I post frequently
  • ***
  • Posts: 216
  • Karma: 3
    • Ryan Kennedy
  • CiviCRM version: 4.3.7
  • CMS version: Drupal 6
Re: Change persmission for 'Find and Merge Duplicate Contacts'
« Reply #10 on: May 26, 2011, 03:34:18 pm »
Hi, I take it this is now in core as there is a 'merge duplicate contacts' permission now with 3.3.6, but I am still getting a permission error when a user with this permission goes to merge contacts from search results:

Sorry. A non-recoverable error has occurred.
You do not have access to this page


What does the permission do, if not this?