ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestAccess Class Reference
+ Collaboration diagram for ilTestAccess:

Public Member Functions

 getAccess ()
 
 setAccess (ilAccessHandler $access)
 
 getRefId ()
 
 setRefId (int $ref_id)
 
 getTestId ()
 
 setTestId (int $test_id)
 
 checkCorrectionsAccess ()
 
 checkScoreParticipantsAccess ()
 
 checkManageParticipantsAccess ()
 
 checkParticipantsResultsAccess ()
 
 checkStatisticsAccess ()
 
 checkResultsAccessForActiveId (int $active_id)
 
 checkScoreParticipantsAccessForActiveId (int $active_id)
 
 checkStatisticsAccessForActiveId (int $active_id)
 

Protected Member Functions

 checkAccessForActiveId (Closure $access_filter, int $active_id)
 

Protected Attributes

ilAccessHandler $access
 
ilDBInterface $db
 
ilLanguage $lng
 
ilTestParticipantAccessFilterFactory $participant_access_filter
 

Detailed Description

Definition at line 29 of file class.ilTestAccess.php.

Member Function Documentation

◆ checkAccessForActiveId()

ilTestAccess::checkAccessForActiveId ( Closure  $access_filter,
int  $active_id 
)
protected

Definition at line 162 of file class.ilTestAccess.php.

References getTestId(), and ILIAS\Repository\lng().

Referenced by checkResultsAccessForActiveId(), checkScoreParticipantsAccessForActiveId(), and checkStatisticsAccessForActiveId().

162  : bool
163  {
164  $participantData = new ilTestParticipantData($this->db, $this->lng);
165  $participantData->setActiveIdsFilter(array($active_id));
166  $participantData->setParticipantAccessFilter($access_filter);
167  $participantData->load($this->getTestId());
168 
169  return in_array($active_id, $participantData->getActiveIds());
170  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkCorrectionsAccess()

ilTestAccess::checkCorrectionsAccess ( )
Returns
bool

Definition at line 85 of file class.ilTestAccess.php.

References getAccess(), and getRefId().

85  : bool
86  {
87  return $this->getAccess()->checkAccess('write', '', $this->getRefId());
88  }
+ Here is the call graph for this function:

◆ checkManageParticipantsAccess()

ilTestAccess::checkManageParticipantsAccess ( )
Returns
bool

Definition at line 109 of file class.ilTestAccess.php.

References getAccess(), getRefId(), and ilOrgUnitOperation\OP_MANAGE_PARTICIPANTS.

109  : bool
110  {
111  if ($this->getAccess()->checkAccess('write', '', $this->getRefId())) {
112  return true;
113  }
114 
115  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_MANAGE_PARTICIPANTS, $this->getRefId())) {
116  return true;
117  }
118 
119  return false;
120  }
+ Here is the call graph for this function:

◆ checkParticipantsResultsAccess()

ilTestAccess::checkParticipantsResultsAccess ( )
Returns
bool

Definition at line 125 of file class.ilTestAccess.php.

References getAccess(), getRefId(), ilOrgUnitOperation\OP_ACCESS_RESULTS, and ilOrgUnitOperation\OP_MANAGE_PARTICIPANTS.

125  : bool
126  {
127  if ($this->getAccess()->checkAccess('write', '', $this->getRefId())) {
128  return true;
129  }
130 
131  if ($this->getAccess()->checkAccess('tst_results', '', $this->getRefId())) {
132  return true;
133  }
134 
135  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_MANAGE_PARTICIPANTS, $this->getRefId())) {
136  return true;
137  }
138 
139  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_ACCESS_RESULTS, $this->getRefId())) {
140  return true;
141  }
142 
143  return false;
144  }
+ Here is the call graph for this function:

◆ checkResultsAccessForActiveId()

ilTestAccess::checkResultsAccessForActiveId ( int  $active_id)

Definition at line 172 of file class.ilTestAccess.php.

References checkAccessForActiveId(), and getRefId().

172  : bool
173  {
174  $access_filter = $this->participant_access_filter->getAccessResultsUserFilter($this->getRefId());
175  return $this->checkAccessForActiveId($access_filter, $active_id);
176  }
checkAccessForActiveId(Closure $access_filter, int $active_id)
+ Here is the call graph for this function:

◆ checkScoreParticipantsAccess()

ilTestAccess::checkScoreParticipantsAccess ( )
Returns
bool

Definition at line 93 of file class.ilTestAccess.php.

References getAccess(), getRefId(), and ilOrgUnitOperation\OP_SCORE_PARTICIPANTS.

93  : bool
94  {
95  if ($this->getAccess()->checkAccess('write', '', $this->getRefId())) {
96  return true;
97  }
98 
99  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_SCORE_PARTICIPANTS, $this->getRefId())) {
100  return true;
101  }
102 
103  return false;
104  }
+ Here is the call graph for this function:

◆ checkScoreParticipantsAccessForActiveId()

ilTestAccess::checkScoreParticipantsAccessForActiveId ( int  $active_id)

Definition at line 178 of file class.ilTestAccess.php.

References checkAccessForActiveId(), and getRefId().

178  : bool
179  {
180  $access_filter = $this->participant_access_filter->getScoreParticipantsUserFilter($this->getRefId());
181  return $this->checkAccessForActiveId($access_filter, $active_id);
182  }
checkAccessForActiveId(Closure $access_filter, int $active_id)
+ Here is the call graph for this function:

◆ checkStatisticsAccess()

ilTestAccess::checkStatisticsAccess ( )
Returns
bool

Definition at line 149 of file class.ilTestAccess.php.

References getAccess(), getRefId(), and ilOrgUnitOperation\OP_ACCESS_RESULTS.

149  : bool
150  {
151  if ($this->getAccess()->checkAccess('tst_statistics', '', $this->getRefId())) {
152  return true;
153  }
154 
155  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_ACCESS_RESULTS, $this->getRefId())) {
156  return true;
157  }
158 
159  return false;
160  }
+ Here is the call graph for this function:

◆ checkStatisticsAccessForActiveId()

ilTestAccess::checkStatisticsAccessForActiveId ( int  $active_id)

Definition at line 184 of file class.ilTestAccess.php.

References checkAccessForActiveId(), and getRefId().

184  : bool
185  {
186  $access_filter = $this->participant_access_filter->getAccessStatisticsUserFilter($this->getRefId());
187  return $this->checkAccessForActiveId($access_filter, $active_id);
188  }
checkAccessForActiveId(Closure $access_filter, int $active_id)
+ Here is the call graph for this function:

◆ getAccess()

ilTestAccess::getAccess ( )

Definition at line 52 of file class.ilTestAccess.php.

References $access.

Referenced by checkCorrectionsAccess(), checkManageParticipantsAccess(), checkParticipantsResultsAccess(), checkScoreParticipantsAccess(), and checkStatisticsAccess().

53  {
54  return $this->access;
55  }
ilAccessHandler $access
+ Here is the caller graph for this function:

◆ getRefId()

◆ getTestId()

ilTestAccess::getTestId ( )

Definition at line 72 of file class.ilTestAccess.php.

Referenced by checkAccessForActiveId().

72  : int
73  {
74  return $this->test_id;
75  }
+ Here is the caller graph for this function:

◆ setAccess()

ilTestAccess::setAccess ( ilAccessHandler  $access)

Definition at line 57 of file class.ilTestAccess.php.

References $access, and ILIAS\Repository\access().

58  {
59  $this->access = $access;
60  }
ilAccessHandler $access
+ Here is the call graph for this function:

◆ setRefId()

ilTestAccess::setRefId ( int  $ref_id)

Definition at line 67 of file class.ilTestAccess.php.

References $ref_id.

68  {
69  $this->ref_id = $ref_id;
70  }
$ref_id
Definition: ltiauth.php:67

◆ setTestId()

ilTestAccess::setTestId ( int  $test_id)

Definition at line 77 of file class.ilTestAccess.php.

78  {
79  $this->test_id = $test_id;
80  }

Field Documentation

◆ $access

ilAccessHandler ilTestAccess::$access
protected

Definition at line 31 of file class.ilTestAccess.php.

Referenced by getAccess(), and setAccess().

◆ $db

ilDBInterface ilTestAccess::$db
protected

Definition at line 32 of file class.ilTestAccess.php.

◆ $lng

ilLanguage ilTestAccess::$lng
protected

Definition at line 33 of file class.ilTestAccess.php.

◆ $participant_access_filter

ilTestParticipantAccessFilterFactory ilTestAccess::$participant_access_filter
protected

Definition at line 35 of file class.ilTestAccess.php.


The documentation for this class was generated from the following file: