CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Using ACL to make the Groups tab "read-only"
Pages: [1]

Author Topic: Using ACL to make the Groups tab "read-only"  (Read 2314 times)

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Using ACL to make the Groups tab "read-only"
December 06, 2008, 11:10:02 pm
Because the synchronisation with Drupal is one way only, we are thinking about a way to prevent people from using the Groups tab to move people from group to group instead of going through Drupal, which is the proper way to do it.  I'd like to find out if there is a way to limit the Groups tab to a read-only view.

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: Using ACL to make the Groups tab "read-only"
December 07, 2008, 08:14:16 am

This is currently not possible via a configuration option. You'll need to hack the code to make this happen

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

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Using ACL to make the Groups tab "read-only"
December 13, 2008, 05:34:11 pm
What about a way to inhibit the [Remove] and [Rejoin group] links? This would serve the same purpose. Alternatively we might put a warning on the page for the tab that tells admins not to use this method of removing people from groups. Inhibiting the link is best, though.

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: Using ACL to make the Groups tab "read-only"
December 14, 2008, 07:52:42 am

thats a much easier customization. You can add / remove those links based on the drupal role and permissions. You can put that code in your customized templates (also available in 1.9). Rob T should be able to do the needful

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

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Using ACL to make the Groups tab "read-only"
December 21, 2008, 03:13:57 am
Can you give me some more hints on how to do this or point me to the documentation?

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: Using ACL to make the Groups tab "read-only"
December 21, 2008, 05:59:28 am

check:

http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in,+Profile,+Contribution+and+Event+Registration+Screens

to customie templates. The group template is here: CRM/Contact/Page/View/GroupContact.tpl

You can suppress the links based on the drupal permissions of the user. You can put php code in the smarty template and hence do a user_access check

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

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Using ACL to make the Groups tab "read-only"
December 27, 2008, 01:10:41 am
We would want to have a special permission that would have the privilege to use the [Remove] link. The code only checks for "Edit". How can I add a new permission to the CiviCRM permissions in Drupal? I am beginning to think  this would be easier to do by assigning these privileged users to an access control group. I am not clear how the template code would be able to query ACL group to see if the logged in user is a member or not.

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: Using ACL to make the Groups tab "read-only"
December 27, 2008, 03:29:49 pm

The best way would be to create a drupal module and add those new permissions to drupal access control (hook_perm). I think you can do something like

Code: [Select]
{if user_access( 'show remove link' )}
{/if}

or something like that

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

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Using ACL to make the Groups tab "read-only"
December 27, 2008, 04:05:14 pm
That's a good suggestion.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Using ACL to make the Groups tab "read-only"

This forum was archived on 2017-11-26.