@@ -483,10 +483,10 @@ public function getOwnAttendeeAllowedExtraQuestions($summit_id)
483483 public function getAttendeeExtraQuestions ($ summit_id , $ attendee_id )
484484 {
485485 $ summit = SummitFinderStrategyFactory::build ($ this ->getSummitRepository (), $ this ->getResourceServerContext ())->find ($ summit_id );
486- if (is_null ($ summit )) return $ this ->error404 ("Summit not found " );
486+ if (is_null ($ summit )) return $ this ->error404 ("Summit not found. " );
487487
488488 $ attendee = $ summit ->getAttendeeById (intval ($ attendee_id ));
489- if (is_null ($ attendee )) return $ this ->error404 ("Attendee not found " );
489+ if (is_null ($ attendee )) return $ this ->error404 ("Attendee not found. " );
490490
491491 // authz
492492 // check that we have a current member ( not service account )
@@ -499,7 +499,12 @@ public function getAttendeeExtraQuestions($summit_id, $attendee_id)
499499
500500 if (!$ auth ){
501501 // check if current member is the attendee
502- $ auth = $ attendee ->getEmail () == $ current_member ->getEmail () || $ attendee ->getMemberId () == $ current_member ->getId ();
502+ $ auth = (
503+ $ attendee ->getEmail () == $ current_member ->getEmail ()
504+ || $ attendee ->getMemberId () == $ current_member ->getId ()
505+ || $ attendee ->isManagedBy ($ current_member )
506+ );
507+
503508 if (!$ auth ){
504509 // check if the attendee is under some order of the current member
505510 foreach ($ current_member ->getPadRegistrationOrdersForSummit ($ summit ) as $ order ){
@@ -513,7 +518,7 @@ public function getAttendeeExtraQuestions($summit_id, $attendee_id)
513518 }
514519
515520 if (!$ auth )
516- return $ this ->error401 ( );
521+ return $ this ->error403 ( " You are not Authorized. " );
517522
518523 return $ this ->_getAll (
519524 function () {
0 commit comments