ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestAccess Class Reference
+ Collaboration diagram for ilTestAccess:

Public Member Functions

 __construct ($refId, $testId)
 
 getAccess ()
 
 setAccess ($access)
 
 getRefId ()
 
 setRefId ($refId)
 
 getTestId ()
 
 setTestId ($testId)
 
 checkCorrectionsAccess ()
 
 checkScoreParticipantsAccess ()
 
 checkManageParticipantsAccess ()
 
 checkParticipantsResultsAccess ()
 
 checkStatisticsAccess ()
 
 checkResultsAccessForActiveId ($activeId)
 
 checkScoreParticipantsAccessForActiveId ($activeId)
 
 checkStatisticsAccessForActiveId ($activeId)
 

Protected Member Functions

 checkAccessForActiveId ($accessFilter, $activeId)
 

Protected Attributes

 $access
 
 $refId
 
 $testId
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestAccess::__construct (   $refId,
  $testId 
)
Parameters
integer$refId
integer$testId

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

References $DIC, $refId, $testId, setAccess(), setRefId(), and setTestId().

49  {
50  global $DIC; /* @var ILIAS\DI\Container $DIC */
51  $this->setAccess($DIC->access());
52 
53  $this->setRefId($refId);
54  $this->setTestId($testId);
55  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ checkAccessForActiveId()

ilTestAccess::checkAccessForActiveId (   $accessFilter,
  $activeId 
)
protected
Parameters
callable$participantAccessFilter
integer$activeId
Returns
bool

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

References $DIC, getTestId(), and ilTestParticipantData\setActiveIdsFilter().

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

190  : bool
191  {
192  global $DIC; /* @var ILIAS\DI\Container $DIC */
193 
194  $participantData = new ilTestParticipantData($DIC->database(), $DIC->language());
195  $participantData->setActiveIdsFilter(array($activeId));
196  $participantData->setParticipantAccessFilter($accessFilter);
197  $participantData->load($this->getTestId());
198 
199  return in_array($activeId, $participantData->getActiveIds());
200  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkCorrectionsAccess()

ilTestAccess::checkCorrectionsAccess ( )
Returns
bool

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

References getAccess(), and getRefId().

108  : bool
109  {
110  return $this->getAccess()->checkAccess('write', '', $this->getRefId());
111  }
+ Here is the call graph for this function:

◆ checkManageParticipantsAccess()

ilTestAccess::checkManageParticipantsAccess ( )
Returns
bool

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

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

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

◆ checkParticipantsResultsAccess()

ilTestAccess::checkParticipantsResultsAccess ( )
Returns
bool

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

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

148  : bool
149  {
150  if ($this->getAccess()->checkAccess('write', '', $this->getRefId())) {
151  return true;
152  }
153 
154  if ($this->getAccess()->checkAccess('tst_results', '', $this->getRefId())) {
155  return true;
156  }
157 
158  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_MANAGE_PARTICIPANTS, $this->getRefId())) {
159  return true;
160  }
161 
162  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_ACCESS_RESULTS, $this->getRefId())) {
163  return true;
164  }
165 
166  return false;
167  }
+ Here is the call graph for this function:

◆ checkResultsAccessForActiveId()

ilTestAccess::checkResultsAccessForActiveId (   $activeId)
Parameters
integer$activeId
Returns
bool

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

References checkAccessForActiveId(), ilTestParticipantAccessFilter\getAccessResultsUserFilter(), and getRefId().

206  : bool
207  {
209  return $this->checkAccessForActiveId($accessFilter, $activeId);
210  }
checkAccessForActiveId($accessFilter, $activeId)
+ Here is the call graph for this function:

◆ checkScoreParticipantsAccess()

ilTestAccess::checkScoreParticipantsAccess ( )
Returns
bool

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

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

116  : bool
117  {
118  if ($this->getAccess()->checkAccess('write', '', $this->getRefId())) {
119  return true;
120  }
121 
122  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_SCORE_PARTICIPANTS, $this->getRefId())) {
123  return true;
124  }
125 
126  return false;
127  }
+ Here is the call graph for this function:

◆ checkScoreParticipantsAccessForActiveId()

ilTestAccess::checkScoreParticipantsAccessForActiveId (   $activeId)
Parameters
integer$activeId
Returns
bool

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

References checkAccessForActiveId(), getRefId(), and ilTestParticipantAccessFilter\getScoreParticipantsUserFilter().

216  : bool
217  {
219  return $this->checkAccessForActiveId($accessFilter, $activeId);
220  }
checkAccessForActiveId($accessFilter, $activeId)
+ Here is the call graph for this function:

◆ checkStatisticsAccess()

ilTestAccess::checkStatisticsAccess ( )
Returns
bool

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

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

172  : bool
173  {
174  if ($this->getAccess()->checkAccess('tst_statistics', '', $this->getRefId())) {
175  return true;
176  }
177 
178  if ($this->getAccess()->checkPositionAccess(ilOrgUnitOperation::OP_ACCESS_RESULTS, $this->getRefId())) {
179  return true;
180  }
181 
182  return false;
183  }
+ Here is the call graph for this function:

◆ checkStatisticsAccessForActiveId()

ilTestAccess::checkStatisticsAccessForActiveId (   $activeId)
Parameters
integer$activeId
Returns
bool

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

References checkAccessForActiveId(), ilTestParticipantAccessFilter\getAccessStatisticsUserFilter(), and getRefId().

226  : bool
227  {
229  return $this->checkAccessForActiveId($accessFilter, $activeId);
230  }
checkAccessForActiveId($accessFilter, $activeId)
+ Here is the call graph for this function:

◆ getAccess()

ilTestAccess::getAccess ( )

◆ getRefId()

◆ getTestId()

ilTestAccess::getTestId ( )
Returns
int

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

References $testId.

Referenced by checkAccessForActiveId().

92  : int
93  {
94  return $this->testId;
95  }
+ Here is the caller graph for this function:

◆ setAccess()

ilTestAccess::setAccess (   $access)
Parameters
ilAccessHandler$access

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

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

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRefId()

ilTestAccess::setRefId (   $refId)
Parameters
int$refId

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

References $refId.

Referenced by __construct().

85  {
86  $this->refId = $refId;
87  }
+ Here is the caller graph for this function:

◆ setTestId()

ilTestAccess::setTestId (   $testId)
Parameters
int$testId

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

References $testId.

Referenced by __construct().

101  {
102  $this->testId = $testId;
103  }
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilTestAccess::$access
protected

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

Referenced by getAccess(), and setAccess().

◆ $refId

ilTestAccess::$refId
protected

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

Referenced by __construct(), getRefId(), and setRefId().

◆ $testId

ilTestAccess::$testId
protected

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

Referenced by __construct(), getTestId(), and setTestId().


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