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.
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).
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}
For the search action see the ques, Controlling Available Search Kit Actions at a Granular Level. You would remove:
Note the extension, Civi improvement route @petednz -fuzion recommends is preferred for a comprehensive solution.
Looks like it does not have a specific 'use Tags' permission. It does have
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.