1

I would like to use tags only as admin. Is there a setting to prevent other users to use them?

I have looked into the roles in Drupal, but could not find it.

2 Answers 2

0

It depends on if you mean admins should only add / remove tags on contacts or if no one else should be able to see and use them in any search? There are two main places where tags are updated: On the Contact Summary Screen and on two search results actions. (Also on the import screen final step, but you probably won't have them importing).

Contact Summary Screen

You could use the Contact Summary Editor to have a layout only for admins which shows the "Tags" tab and another for non-admins which hides it.

If the "ID, Type and Tags" block is present, clicking tags will not do anything. You could hide this block entirely and then just make a new block for tags if you only want non-admin users to view them. To do that, make sure you set the tags field in the new block as "View Only".

If you wanted to get fancier and only want to have a certain set of tags be editable by admins, you could use a custom template Tag.extra file and add something like this at your [your_path]/CRM/Contact/Page/View/Tag.extra.tpl, where you find the proper CSS selector, where "X" is the tagset ID.

{if !call_user_func(array('CRM_Core_Permission','check'), 'administer CiviCRM')}
{literal}
<script>
 CRM.$( function( $ ) {
     $( document ).ajaxComplete(function( event, request, settings ) {
     $(".crm-section.tag-section.contact-tagset.contact-tagset-X-section").remove();
      })
    });
</script>
{/literal}
{/if}

Search Result Actions

For the search action see the ques, Controlling Available Search Kit Actions at a Granular Level. You would remove:

  • Tag - add to contacts
  • Tag - remove from contacts

Note the extension, Civi improvement route @petednz -fuzion recommends is preferred for a comprehensive solution.

1
1

Looks like it does not have a specific 'use Tags' permission. It does have

  • CiviCRM: edit all contacts: View, Edit and Delete ANY CONTACT in the CiviCRM database; Create and edit relationships, tags and other info about the contacts
  • CiviCRM: manage tags: Create and rename tags

So i think this would require an extension to add that additional Permission along with the associated changes to then make it apply in civi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.