31 $this->role_id = $a_role_id;
40 $this->role_id = $a_role_id;
43 function add($a_item_id,$a_item_type)
47 if($a_item_type and $a_item_id)
49 $next_id = $ilDB->nextId(
'role_desktop_items');
50 $query =
"INSERT INTO role_desktop_items (role_item_id,role_id,item_id,item_type) ".
52 $ilDB->quote($next_id,
'integer').
','.
53 $ilDB->quote($this->
getRoleId(),
'integer').
", ".
54 $ilDB->quote($a_item_id,
'integer').
", ".
55 $ilDB->quote($a_item_type,
'text').
" ".
58 $this->
__assign($a_item_id,$a_item_type);
64 function delete($a_role_item_id)
68 $query =
"DELETE FROM role_desktop_items ".
69 "WHERE role_item_id = ".$ilDB->quote($a_role_item_id,
'integer');
79 $query =
"DELETE FROM role_desktop_items ".
80 "WHERE role_id = ".$ilDB->quote($this->
getRoleId(),
'integer');
90 $query =
"SELECT * FROM role_desktop_items ".
91 "WHERE role_id = ".$ilDB->quote($this->
getRoleId(),
'integer').
" ".
92 "AND item_id = ".$ilDB->quote($a_item_ref_id,
'integer').
" ";
95 return $res->numRows() ?
true :
false;
102 $query =
"SELECT * FROM role_desktop_items ".
103 "WHERE role_id = ".$ilDB->quote($this->
getRoleId(),
'integer').
" ".
104 "AND role_item_id = ".$ilDB->quote($a_role_item_id,
'integer').
" ";
109 $item[
'item_id'] =
$row->item_id;
110 $item[
'item_type'] =
$row->item_type;
113 return $item ? $item : array();
123 $query =
"SELECT * FROM role_desktop_items ".
124 "WHERE role_id = ".$this->db->quote($this->
getRoleId(),
'integer').
" ";
130 if(!$tree->isInTree(
$row->item_id))
132 $this->
delete(
$row->role_item_id);
135 $items[
$row->role_item_id][
'item_id'] =
$row->item_id;
136 $items[
$row->role_item_id][
'item_type'] =
$row->item_type;
139 return $items ? $items : array();
147 foreach($rbacreview->assignedUsers($this->getRoleId()) as $user_id)
151 if(!$tmp_user->isDesktopItem($a_item_id,$a_item_type))
153 $tmp_user->addDesktopItem($a_item_id,$a_item_type);