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) »
  • Participiant create activitiy subject to permissions
Pages: [1]

Author Topic: Participiant create activitiy subject to permissions  (Read 541 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Participiant create activitiy subject to permissions
May 17, 2011, 01:00:34 pm
I have finally got testing going on my custom civi modules & I found that when I did Participant Create under a user with more limited permissions (register for event) I got an eNotice on activity create. It turned out that when it creates an activity it tests the event through CRM_Event_BAO_Event::getEvents & if the event id is not returned it can't create the activity. The getEvents function doesn't return the event id if the event is inactive, not current, or the user doesn't have a level of permissions an anonymous user wouldn't normally have (e.g. edit all events )

I would argue that if a participant is created then an activity should be created & checking doesn't belong. If there does have to be checking, however, I don't think permissions should be checked for creating an activity.


Code: [Select]
        } else if ( $activity->__table == 'civicrm_participant' ) {
            require_once "CRM/Event/BAO/Event.php";
            $event = CRM_Event_BAO_Event::getEvents( true, $activity->event_id );
           
            require_once "CRM/Event/PseudoConstant.php";
            $roles  = CRM_Event_PseudoConstant::participantRole( );
            $status = CRM_Event_PseudoConstant::participantStatus( );
           
[b]            $subject = $event[$activity->event_id];[/b]

(last line gives the E-Notice)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Participiant create activitiy subject to permissions

This forum was archived on 2017-11-26.