ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjectAccess Class Reference

Class ilObjectAccess. More...

+ Inheritance diagram for ilObjectAccess:
+ Collaboration diagram for ilObjectAccess:

Public Member Functions

 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Detailed Description

Class ilObjectAccess.

This class contains methods that check object specific conditions for access to objects. Every object type should provide an inherited class called ilObj<TypeName>Access

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

◆ _checkAccess()

ilObjectAccess::_checkAccess (   $a_cmd,
  $a_permission,
  $a_ref_id,
  $a_obj_id,
  $a_user_id = "" 
)

Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Reimplemented in ilObjBibliographicAccess, ilObjBookingPoolAccess, ilObjChatroomAccess, ilObjCloudAccess, ilObjCourseAccess, ilObjCourseReferenceAccess, ilObjDataCollectionAccess, ilObjGlossaryAccess, ilObjGroupAccess, ilObjGroupReferenceAccess, ilObjFileBasedLMAccess, ilObjItemGroupAccess, ilObjContentObjectAccess, ilObjMediaCastAccess, ilObjPollAccess, ilObjPortfolioTemplateAccess, ilObjRemoteCourseAccess, ilObjRemoteGlossaryAccess, ilObjRemoteGroupAccess, ilObjRemoteLearningModuleAccess, ilObjRemoteTestAccess, ilObjRemoteWikiAccess, ilObjSAHSLearningModuleAccess, ilObjSessionAccess, ilObjStudyProgrammeAccess, ilObjStudyProgrammeReferenceAccess, ilObjSurveyAccess, ilObjTestAccess, ilObjQuestionPoolAccess, ilObjLinkResourceAccess, ilObjWikiAccess, ilContainerReferenceAccess, ilObjPrivacySecurityAccess, ilObjectPluginAccess, ilObjUserAccess, ilObjWorkflowEngineAccess, and ilObjLearningSequenceAccess.

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

34 {
35
36 // add no access info item and return false if access is not granted
37 // $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $a_text, $a_data = "");
38 //
39 // for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:
40 // $rbacsystem->checkAccessOfUser($a_user_id, $a_permission, $a_ref_id)
41
42 return true;
43 }

◆ _checkCondition()

ilObjectAccess::_checkCondition (   $a_obj_id,
  $a_operator,
  $a_value,
  $a_usr_id 
)

check condition

this method is called by ilConditionHandler

Reimplemented in ilObjectPluginAccess.

Definition at line 50 of file class.ilObjectAccess.php.

51 {
52 switch ($a_operator) {
53 default:
54 return true;
55 }
56 }

◆ _checkGoto()

static ilObjectAccess::_checkGoto (   $a_target)
static

◆ _getCommands()

static ilObjectAccess::_getCommands ( )
static

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Reimplemented in ilObjBibliographicAccess, ilObjBlogAccess, ilObjBookingPoolAccess, ilObjCategoryAccess, ilObjChatroomAccess, ilObjChatroomAdminAccess, ilObjCloudAccess, ilObjCmiXapiAccess, ilObjCmiXapiVerificationAccess, ilObjContentPageAccess, ilObjCourseAccess, ilObjCourseVerificationAccess, ilObjDataCollectionAccess, ilObjExerciseAccess, ilObjExerciseVerificationAccess, ilObjExternalFeedAccess, ilObjFileAccess, ilObjFolderAccess, ilObjForumAccess, ilObjGlossaryAccess, ilObjGroupAccess, ilObjFileBasedLMAccess, ilObjIndividualAssessmentAccess, ilObjItemGroupAccess, ilObjLearningModuleAccess, ilObjLearningSequenceAccess, ilObjLTIConsumerAccess, ilObjLTIConsumerVerificationAccess, ilObjMediaCastAccess, ilObjMediaPoolAccess, ilObjOrgUnitAccess, ilObjPollAccess, ilObjPortfolioTemplateAccess, ilObjRemoteCategoryAccess, ilObjRemoteCourseAccess, ilObjRemoteFileAccess, ilObjRemoteGlossaryAccess, ilObjRemoteGroupAccess, ilObjRemoteLearningModuleAccess, ilObjRemoteTestAccess, ilObjRemoteWikiAccess, ilObjRootFolderAccess, ilObjSCORMVerificationAccess, ilObjSessionAccess, ilObjStudyProgrammeAccess, ilObjSurveyAccess, ilObjSurveyQuestionPoolAccess, ilObjTestAccess, ilObjTestVerificationAccess, ilObjQuestionPoolAccess, ilObjLinkResourceAccess, ilObjWikiAccess, ilObjWorkspaceFolderAccess, ilObjWorkspaceRootFolderAccess, ilObjNotificationAdminAccess, ilObjectPluginAccess, and ilObjUserAccess.

Definition at line 70 of file class.ilObjectAccess.php.

71 {
72 $commands = array(
73 array()
74 );
75
76 return $commands;
77 }

Referenced by ilObjectListGUI\init(), ilObjCategoryReferenceListGUI\initItem(), ilObjCourseReferenceListGUI\initItem(), ilObjGroupReferenceListGUI\initItem(), ilObjSAHSLearningModuleListGUI\initItem(), and ilObjStudyProgrammeReferenceListGUI\initItem().

+ Here is the caller graph for this function:

◆ _isOffline()

static ilObjectAccess::_isOffline (   $a_obj_id)
static

Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling.

Used in ListGUI and Learning Progress

Parameters
int$a_obj_id
Returns
bool

Reimplemented in ilObjCourseAccess, and ilObjTestAccess.

Definition at line 106 of file class.ilObjectAccess.php.

107 {
108 global $DIC;
109
110 $objDefinition = $DIC['objDefinition'];
111 if ($objDefinition->supportsOfflineHandling(ilObject::_lookupType($a_obj_id))) {
112 return ilObject::lookupOfflineStatus($a_obj_id);
113 }
114 return null;
115 }
static lookupOfflineStatus($a_obj_id)
Lookup offline status using objectDataCache.
static _lookupType($a_id, $a_reference=false)
lookup object type

References $DIC, ilObject\_lookupType(), and ilObject\lookupOfflineStatus().

Referenced by ilObjCmiXapiListGUI\getProperties(), and ilObjLTIConsumerListGUI\getProperties().

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

◆ _preloadData()

static ilObjectAccess::_preloadData (   $a_obj_ids,
  $a_ref_ids 
)
static

Preload data.

Parameters
array$a_obj_idsarray of object ids

Reimplemented in ilObjCourseAccess, ilObjCourseReferenceAccess, ilObjFileAccess, ilObjGroupAccess, ilObjFileBasedLMAccess, ilObjContentObjectAccess, ilObjSessionAccess, ilObjLinkResourceAccess, and ilObjForumAccess.

Definition at line 122 of file class.ilObjectAccess.php.

123 {
124 }

◆ canBeDelivered()

ilObjectAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Parameters
ilWACPath$ilWACPath
Returns
bool

Implements ilWACCheckingClass.

Reimplemented in ilObjBlogAccess, ilObjBookingPoolAccess, ilObjChatroomAccess, ilObjExerciseAccess, ilObjFileAccess, ilObjPollAccess, and ilObjUserAccess.

Definition at line 129 of file class.ilObjectAccess.php.

130 {
131 global $ilAccess;
132
133 preg_match("/\\/obj_([\\d]*)\\//uism", $ilWACPath->getPath(), $results);
134 foreach (ilObject2::_getAllReferences($results[1]) as $ref_id) {
135 if ($ilAccess->checkAccess('visible', '', $ref_id) || $ilAccess->checkAccess('read', '', $ref_id)) {
136 return true;
137 }
138 }
139
140 return false;
141 }
static _getAllReferences($a_id)
get all reference ids of object
$results

References $results, ilObject2\_getAllReferences(), and ilWACPath\getPath().

+ Here is the call graph for this function:

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