51 $this->role_id = $a_role_id;
60 $this->role_id = $a_role_id;
63 function add($a_item_id,$a_item_type)
67 if($a_item_type and $a_item_id)
69 $query =
"INSERT INTO role_desktop_items ".
70 "SET role_id = ".$ilDB->quote($this->
getRoleId()).
", ".
71 "item_id = ".$ilDB->quote($a_item_id).
", ".
72 "item_type = ".$ilDB->quote($a_item_type);
74 $this->db->query($query);
76 $this->
__assign($a_item_id,$a_item_type);
82 function delete($a_role_item_id)
86 $query =
"DELETE FROM role_desktop_items ".
87 "WHERE role_item_id = ".$ilDB->quote($a_role_item_id);
89 $this->db->query($query);
98 $query =
"DELETE FROM role_desktop_items ".
99 "WHERE role_id = ".$ilDB->quote($this->
getRoleId());
101 $this->db->query($query);
110 $query =
"SELECT * FROM role_desktop_items ".
111 "WHERE role_id = ".$ilDB->quote($this->
getRoleId()).
" ".
112 "AND item_id = ".$ilDB->quote($a_item_ref_id).
" ";
114 $res = $this->db->query($query);
116 return $res->numRows() ?
true :
false;
123 $query =
"SELECT * FROM role_desktop_items ".
124 "WHERE role_id = ".$ilDB->quote($this->
getRoleId()).
" ".
125 "AND role_item_id = ".$ilDB->quote($a_role_item_id).
" ";
127 $res = $this->db->query($query);
130 $item[
'item_id'] = $row->item_id;
131 $item[
'item_type'] = $row->item_type;
134 return $item ? $item : array();
143 $query =
"SELECT * FROM role_desktop_items ".
144 "WHERE role_id = ".$this->db->quote($this->
getRoleId()).
" ";
146 $res = $this->db->query($query);
150 if(!$tree->isInTree($row->item_id))
152 $this->
delete($row->role_item_id);
155 $items[$row->role_item_id][
'item_id'] = $row->item_id;
156 $items[$row->role_item_id][
'item_type'] = $row->item_type;
159 return $items ? $items : array();
167 foreach($rbacreview->assignedUsers($this->getRoleId()) as $user_id)
171 if(!$tmp_user->isDesktopItem($a_item_id,$a_item_type))
173 $tmp_user->addDesktopItem($a_item_id,$a_item_type);