ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjUserAccess Class Reference

Class ilObjUserAccess. More...

+ Inheritance diagram for ilObjUserAccess:
+ Collaboration diagram for ilObjUserAccess:

Public Member Functions

 _getCommands ()
 get commands More...
 
 _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...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
- Public Member Functions inherited from 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) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 

Detailed Description

Member Function Documentation

◆ _checkAccess()

ilObjUserAccess::_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 from ilObjectAccess.

Definition at line 25 of file class.ilObjUserAccess.php.

25 {
26 die();
27 }

◆ _checkGoto()

ilObjUserAccess::_checkGoto (   $a_target)

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

33 {
34 return true;
35 }

◆ _getCommands()

ilObjUserAccess::_getCommands ( )

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 from ilObjectAccess.

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

20 {
21 die();
22 }

◆ canBeDelivered()

ilObjUserAccess::canBeDelivered ( ilWACPath  $ilWACPath)
Parameters
ilWACPath$ilWACPath
Returns
bool

Implements ilWACCheckingClass.

Definition at line 43 of file class.ilObjUserAccess.php.

43 {
44 global $ilUser, $ilSetting;
45
46 preg_match("/usr_(\\d*).*/ui", $ilWACPath->getFileName(), $matches);
47 $usr_id = $matches[1];
48
49 // check if own image is viewed
50 if ($usr_id == $ilUser->getId()) {
51 return true;
52 }
53
54 // check if image is in the public profile
55 $public_upload = ilObjUser::_lookupPref($usr_id, 'public_upload');
56 if ($public_upload != 'y') {
57 return false;
58 }
59
60 // check the publication status of the profile
61 $public_profile = ilObjUser::_lookupPref($usr_id, 'public_profile');
62
63 if ($public_profile == 'g' and $ilSetting->get('enable_global_profiles') and $ilSetting->get('pub_section')) {
64 // globally public
65 return true;
66 } elseif (($public_profile == 'y' or $public_profile == 'g') and $ilUser->getId() != ANONYMOUS_USER_ID && $ilUser->getId() != 0) {
67 // public for logged in users
68 return true;
69 } else {
70 // not public
71 return false;
72 }
73 }
_lookupPref($a_usr_id, $a_keyword)
global $ilSetting
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15

References $ilSetting, $ilUser, ilObjUser\_lookupPref(), and ilWACPath\getFileName().

+ Here is the call graph for this function:

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