ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLTIConsumerAccess Class Reference
+ Collaboration diagram for ilLTIConsumerAccess:

Public Member Functions

 __construct (ilObjLTIConsumer $object)
 ilLTIConsumerAccess constructor. More...
 
 hasWriteAccess ()
 
 hasOutcomesAccess ()
 
 hasEditPermissionsAccess ()
 
 hasLearningProgressAccess ()
 
 hasStatementsAccess ()
 
 hasHighscoreAccess ()
 

Static Public Member Functions

static getInstance (ilObjLTIConsumer $object)
 
static hasCustomProviderCreationAccess ()
 

Data Fields

const GLOBAL_ADMIN_ROLE_ID = 2
 

Protected Member Functions

 checkAccess ($permission)
 

Protected Attributes

 $object
 

Detailed Description

Definition at line 14 of file class.ilLTIConsumerAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilLTIConsumerAccess::__construct ( ilObjLTIConsumer  $object)

ilLTIConsumerAccess constructor.

Parameters
ilObjLTIConsumer$object

Definition at line 26 of file class.ilLTIConsumerAccess.php.

References $object.

27  {
28  $this->object = $object;
29  }

Member Function Documentation

◆ checkAccess()

ilLTIConsumerAccess::checkAccess (   $permission)
protected
Parameters
$permission
Returns
bool

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

References $DIC.

Referenced by hasEditPermissionsAccess(), hasOutcomesAccess(), and hasWriteAccess().

36  {
37  global $DIC; /* @var \ILIAS\DI\Container $DIC */
38 
39  return $DIC->access()->checkAccess(
40  $permission,
41  '',
42  $this->object->getRefId(),
43  $this->object->getType(),
44  $this->object->getId()
45  );
46  }
global $DIC
Definition: goto.php:24
+ Here is the caller graph for this function:

◆ getInstance()

static ilLTIConsumerAccess::getInstance ( ilObjLTIConsumer  $object)
static
Parameters
ilObjLTIConsumer$object
Returns
ilLTIConsumerAccess

Definition at line 113 of file class.ilLTIConsumerAccess.php.

References $object.

Referenced by ilLTIConsumerXapiStatementsGUI\__construct(), and ilLTIConsumerScoringGUI\__construct().

114  {
115  return new self($object);
116  }
+ Here is the caller graph for this function:

◆ hasCustomProviderCreationAccess()

static ilLTIConsumerAccess::hasCustomProviderCreationAccess ( )
static
Returns
bool

Definition at line 121 of file class.ilLTIConsumerAccess.php.

References $DIC, and ilObjLTIAdministration\lookupLTISettingsRefId().

Referenced by ilObjLTIConsumerGUI\afterSave(), ilObjLTIConsumerGUI\initCreationForms(), and ilObjLTIConsumerGUI\saveCustom().

122  {
123  global $DIC; /* @var \ILIAS\DI\Container $DIC */
124 
125  return $DIC->rbac()->system()->checkAccess(
126  'add_consume_provider',
128  );
129  }
static lookupLTISettingsRefId()
Lookup ref_id.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasEditPermissionsAccess()

ilLTIConsumerAccess::hasEditPermissionsAccess ( )

Definition at line 64 of file class.ilLTIConsumerAccess.php.

References checkAccess().

65  {
66  return $this->checkAccess('edit_permission');
67  }
+ Here is the call graph for this function:

◆ hasHighscoreAccess()

ilLTIConsumerAccess::hasHighscoreAccess ( )
Returns
bool

Definition at line 96 of file class.ilLTIConsumerAccess.php.

References hasOutcomesAccess().

97  {
98  if (!$this->object->getUseXapi()) {
99  return false;
100  }
101 
102  if ($this->object->getHighscoreEnabled()) {
103  return true;
104  }
105 
106  return $this->hasOutcomesAccess();
107  }
+ Here is the call graph for this function:

◆ hasLearningProgressAccess()

ilLTIConsumerAccess::hasLearningProgressAccess ( )
Returns
bool

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

References ilLearningProgressAccess\checkAccess().

73  {
74  return ilLearningProgressAccess::checkAccess($this->object->getRefId());
75  }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
+ Here is the call graph for this function:

◆ hasOutcomesAccess()

ilLTIConsumerAccess::hasOutcomesAccess ( )

Definition at line 55 of file class.ilLTIConsumerAccess.php.

References checkAccess().

Referenced by hasHighscoreAccess(), and hasStatementsAccess().

56  {
57  if ($this->checkAccess('read_outcomes')) {
58  return true;
59  }
60 
61  return false;
62  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasStatementsAccess()

ilLTIConsumerAccess::hasStatementsAccess ( )
Returns
bool

Definition at line 80 of file class.ilLTIConsumerAccess.php.

References hasOutcomesAccess().

81  {
82  if (!$this->object->getUseXapi()) {
83  return false;
84  }
85 
86  if ($this->object->isStatementsReportEnabled()) {
87  return true;
88  }
89 
90  return $this->hasOutcomesAccess();
91  }
+ Here is the call graph for this function:

◆ hasWriteAccess()

ilLTIConsumerAccess::hasWriteAccess ( )

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

References $DIC, and checkAccess().

49  {
50  global $DIC; /* @var \ILIAS\DI\Container $DIC */
51 
52  return $this->checkAccess('write');
53  }
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Field Documentation

◆ $object

ilLTIConsumerAccess::$object
protected

Definition at line 20 of file class.ilLTIConsumerAccess.php.

Referenced by __construct(), and getInstance().

◆ GLOBAL_ADMIN_ROLE_ID

const ilLTIConsumerAccess::GLOBAL_ADMIN_ROLE_ID = 2

Definition at line 16 of file class.ilLTIConsumerAccess.php.


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