Exemplo n.º 1
0
 /**
  * Check if (current) user has access to the participant list
  * @param type $a_obj
  * @param type $a_usr_id
  */
 public static function hasParticipantListAccess($a_obj_id, $a_usr_id = null)
 {
     if (!$a_usr_id) {
         $a_usr_id = $GLOBALS['ilUser']->getId();
     }
     // if write access granted => return true
     $refs = ilObject::_getAllReferences($a_obj_id);
     $ref_id = end($refs);
     if ($GLOBALS['ilAccess']->checkAccess('write', '', $ref_id)) {
         return true;
     }
     $part = self::getInstanceByObjId($a_obj_id);
     if ($part->isAssigned($a_usr_id)) {
         if ($part->getType() == 'crs') {
             // Check for show_members
             include_once './Modules/Course/classes/class.ilObjCourse.php';
             if (!ilObjCourse::lookupShowMembersEnabled($a_obj_id)) {
                 return false;
             }
         }
         return true;
     }
     // User is not assigned to course/group => no read access
     return false;
 }