ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjPortfolioTemplateAccess Class Reference

Class ilObjPortfolioTemplateAccess. More...

+ Inheritance diagram for ilObjPortfolioTemplateAccess:
+ Collaboration diagram for ilObjPortfolioTemplateAccess:

Public Member Functions

 __construct ()
 Constructor. 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...
 
- 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...
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _lookupOnline ($a_id)
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
- Static Public Member Functions inherited from ilObjectAccess
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. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Protected Attributes

 $user
 
 $lng
 
 $rbacsystem
 
 $access
 

Detailed Description

Class ilObjPortfolioTemplateAccess.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilObjRootFolderAccess.php 15678 2008-01-06 20:40:55Z akill

Definition at line 13 of file class.ilObjPortfolioTemplateAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjPortfolioTemplateAccess::__construct ( )

Constructor.

Definition at line 39 of file class.ilObjPortfolioTemplateAccess.php.

40 {
41 global $DIC;
42
43 $this->user = $DIC->user();
44 $this->lng = $DIC->language();
45 $this->rbacsystem = $DIC->rbac()->system();
46 $this->access = $DIC->access();
47 }
user()
Definition: user.php:4
global $DIC
Definition: saml.php:7

References $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAccess()

ilObjPortfolioTemplateAccess::_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 61 of file class.ilObjPortfolioTemplateAccess.php.

62 {
66 $ilAccess = $this->access;
67
68 if ($a_user_id == "") {
69 $a_user_id = $ilUser->getId();
70 }
71
72 switch ($a_cmd) {
73 case "view":
74 if (!self::_lookupOnline($a_obj_id)
75 && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
76 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
77 return false;
78 }
79 break;
80
81 // for permission query feature
82 case "infoScreen":
83 if (!self::_lookupOnline($a_obj_id)) {
84 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
85 } else {
86 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
87 }
88 break;
89
90 }
91
92 switch ($a_permission) {
93 case "read":
94 case "visible":
95 if (!self::_lookupOnline($a_obj_id) &&
96 (!$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id))) {
97 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
98 return false;
99 }
100 break;
101 }
102
103 return true;
104 }
const IL_STATUS_MESSAGE
const IL_NO_OBJECT_ACCESS
$ilUser
Definition: imgupload.php:18

References $access, $ilUser, $lng, $rbacsystem, $user, IL_NO_OBJECT_ACCESS, and IL_STATUS_MESSAGE.

◆ _checkGoto()

static ilObjPortfolioTemplateAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 115 of file class.ilObjPortfolioTemplateAccess.php.

116 {
117 global $DIC;
118
119 $ilAccess = $DIC->access();
120
121 $t_arr = explode("_", $a_target);
122
123 if ($t_arr[0] != "prtt" || ((int) $t_arr[1]) <= 0) {
124 return false;
125 }
126
127 if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
128 return true;
129 }
130 return false;
131 }

References $DIC.

◆ _getCommands()

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

Definition at line 49 of file class.ilObjPortfolioTemplateAccess.php.

50 {
51 $commands = array(
52 array("permission" => "read", "cmd" => "preview", "lang_var" => "preview", "default" => true),
53 array("permission" => "write", "cmd" => "view", "lang_var" => "edit"),
54 array("permission" => "read", "cmd" => "createfromtemplate", "lang_var" => "prtf_create_portfolio_from_template"),
55 // array("permission" => "write", "cmd" => "export", "lang_var" => "export_html")
56 );
57
58 return $commands;
59 }

Referenced by ilObjPortfolioTemplateListGUI\init().

+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjPortfolioTemplateAccess::_lookupOnline (   $a_id)
static

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

107 {
108 include_once "Modules/Portfolio/classes/class.ilObjPortfolioTemplate.php";
110 }
static lookupOnline($a_id)
Is online?

References ilObjPortfolioBase\lookupOnline().

Referenced by ilObjPortfolioTemplateListGUI\getProperties().

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

Field Documentation

◆ $access

ilObjPortfolioTemplateAccess::$access
protected

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

Referenced by _checkAccess().

◆ $lng

ilObjPortfolioTemplateAccess::$lng
protected

Definition at line 23 of file class.ilObjPortfolioTemplateAccess.php.

Referenced by _checkAccess().

◆ $rbacsystem

ilObjPortfolioTemplateAccess::$rbacsystem
protected

Definition at line 28 of file class.ilObjPortfolioTemplateAccess.php.

Referenced by _checkAccess().

◆ $user

ilObjPortfolioTemplateAccess::$user
protected

Definition at line 18 of file class.ilObjPortfolioTemplateAccess.php.

Referenced by _checkAccess().


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