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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How to restrict Event Configuration Permission
Pages: [1]

Author Topic: How to restrict Event Configuration Permission  (Read 1117 times)

ceford

  • I’m new here
  • *
  • Posts: 20
  • Karma: 2
How to restrict Event Configuration Permission
October 15, 2009, 03:27:07 pm
Hello friends,

I am fairly new to CiviCRM / Drupal and this is my first post. I need some advice on how restrict Event configuration permissions within a multi-branch organisation. Essentially we have say 100 branches who organise Events and recruit Volunteers to send to other branches Events. I have arranged for each contact to have a Branch Code and each Event to have a Branch Code. I figured out how to use the aclWhereClause hook to restrict a Branch Admin's access to his/her own Contacts and the Contacts from other Branches who have registered for his/her Events. That seems to work nicely!

I was rather hoping there would be a similar hook in the Events configuration permissions. I just want to remove the Configure / Disable links in the Event Summary and Manage Events page where the Admin's Branch Code does not match the Event Branch Code. I am not sure of the best way to tackle this. Any pointers would be most welcome.

Cliff

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: How to restrict Event Configuration Permission
October 15, 2009, 03:49:50 pm

might be easier to now show the events to users who are not part of the branch code

check the hook: hook_civicrm_aclGroup:

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmaclGroup

the tableName will be civicrm_event

u can control what events to expose to a user via this hook

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

ceford

  • I’m new here
  • *
  • Posts: 20
  • Karma: 2
Re: How to restrict Event Configuration Permission
October 18, 2009, 03:15:31 pm
The hook_civicrm_aclGroup did not really do what I wanted, but your advice led me to more documentation and to think about other ways of doing things. Using the aclWhere hook in the way I indicated was never going to work properly, but I found an easier way to get the listings I needed. I think I will have to produce custom code to handle our Events because they don't fit the standard concept of an Event (Volunteers can select up to 6 in order of preference and they are selected to ensure a good mix of characteristics), but I will come back on that when I know enough to ask the right questions.

Cliff

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: How to restrict Event Configuration Permission
October 18, 2009, 05:39:49 pm

hey cliff:

can u elaborate on why it did not do what u wanted or what the missing pieces are?

thanx

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

ceford

  • I’m new here
  • *
  • Posts: 20
  • Karma: 2
Re: How to restrict Event Configuration Permission
October 19, 2009, 05:33:19 am
Hi Lobo,

To be honest I have forgotten exactly what the problem was - other than it was my logic and lack of familiarity with everything CiviCRM has to offer. I was trying to combine lists of things that a user has permission to edit with lists of things that a user has permission to view. The combined lists had edit links where they shouldn't. I later realised it was best to keep the lists separate. I may come back to this when I have found the edge pieces to the jigsaw puzzle. Things are a bit complicated because I need to develop something for both Joomla and Drupal.

Cliff

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • How to restrict Event Configuration Permission

This forum was archived on 2017-11-26.