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 CiviMember (Moderator: Deepak Srivastava) »
  • Using CiviCRM (membership) to manage Drupal Access Control
Pages: [1]

Author Topic: Using CiviCRM (membership) to manage Drupal Access Control  (Read 2468 times)

margaux

  • Guest
Using CiviCRM (membership) to manage Drupal Access Control
July 25, 2007, 11:25:42 am
Hi -

Is there any way to use CiviCRM, managing a paid membership in an organization, to control access to Drupal nodes?

The closest thing I've seen seems to be http://drupal.org/project/og_civicrm, which says it syncs organic groups with CiviCRM, but I think it only goes one way -> into CiviCRM.  What we need to do is manage access to certain members-only pages based on their CiviCRM profile.

Any suggestions?

Many thanks,
Margaux O'Malley
Grand Junction Design

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 CiviCRM (membership) to manage Drupal Access Control
July 25, 2007, 12:28:33 pm

I dont know a lot about access control to nodes in drupal, but i suspect you can write a hook that:

1. given a drupal uid, gets the civicrm contact id and relevant member info

2. with the above info decides if the user has permission to accesss the node and returns the info to the access function. You will need to use a combination of the api / civicrm functions to get the info.

So you will need to figure out which node access permissioning system to use and if you can extend that via hooks. Another potential option is to set a drupal role for a civicrm contact based on certain info and use that role for permissioning.

Bottom line, you will need to write some glue code to make this possible

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

Laryn

  • I post frequently
  • ***
  • Posts: 192
  • Karma: 4
    • CEDC
  • CiviCRM version: 4.6.x
  • CMS version: Drupal 7
Re: Using CiviCRM (membership) to manage Drupal Access Control
August 23, 2007, 09:52:44 am
Hmmm.... I am brand new to CiviCRM (and relatively new to Drupal).

I assumed this type of functionality would be included (bad to assume, I know!)... But I'm curious if anyone has managed to get something like this running? Is there any code out there to marry the access control between CiviCRM info and Drupal nodes?
CEDC...social justice by design

*Get support on the new CiviCRM help site. /laryn

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 CiviCRM (membership) to manage Drupal Access Control
August 23, 2007, 02:12:52 pm

Check:

http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/gordon/civicrm_role/

this might be a good start. You will need to upgrade and modify the code to meet your needs

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

haggan

  • Guest
Re: Using CiviCRM (membership) to manage Drupal Access Control
August 30, 2007, 04:01:39 am
There is another possible way

http://www.torenware.com/node/64

to use that Organic Groups Integration. you could creata a smart group of the members in an organisation. The smart group is updated if the search criteria is correct if user is expired graced or deleted and so on.

All contacts in the smart group is added to the Organic Group, and acces to content could be manage with the OG group.

I am also interested in this in many ways and I am also new to both drupal and CiviCRM. But I will do my best to help out with things.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Using CiviCRM (membership) to manage Drupal Access Control

This forum was archived on 2017-11-26.