60 $roles_ids = $this->getRolesIdsByViews($standard_views_for_data_collection);
65 $roles_with_no_read_right_on_any_standard_view = array_diff($roles_with_read_acces_ids, $roles_ids);
67 $roles_data = $this->rbac_review->getRolesForIDs($roles_with_no_read_right_on_any_standard_view,
true);
69 if (!empty($roles_data)) {
70 foreach ($roles_data as $role_data) {
71 $role_titles[] = $role_data[
'title'];
84 $rbac_roles = $this->rbac_review->getParentRoleIds($this->ref_id);
85 $roles_with_read_acces_ids = [];
87 foreach ($rbac_roles as $role) {
88 $operations = $this->rbac_review->getActiveOperationsOfRole($this->ref_id, $role[
'rol_id']);
90 if (!empty($operations) && in_array(3, $operations)) {
91 $roles_with_read_acces_ids[] = $role[
'rol_id'];
95 return $roles_with_read_acces_ids;
104 protected function getRolesIdsByViews($views_for_data_collection)
111 foreach ($views_for_data_collection as
$key => $view_for_data_collection_array_of_objects) {
112 foreach ($view_for_data_collection_array_of_objects as $view_for_data_collection_object) {
113 $ilDclTableView = ilDclTableView::find($view_for_data_collection_object->getId());
114 $roles_of_view = $ilDclTableView->getRoles();
115 $roles_ids = array_merge($roles_ids, $roles_of_view);
130 $standard_views_for_data_collection = [];
131 foreach ($visible_tables_for_data_collection as $visible_table) {
134 'table_id' => $visible_table[
'id']
139 return $standard_views_for_data_collection;
148 $visible_tables_for_data_collection = [];
149 $res = $this->database->queryF(
150 "SELECT * FROM il_dcl_table WHERE obj_id = %s AND is_visible = 1",
154 while ($rec = $this->database->fetchAssoc(
$res)) {
155 $visible_tables_for_data_collection[] = $rec;
158 return $visible_tables_for_data_collection;
165 if ($this->
user->getId() == 6) {
172 $roles_ids = $this->getRolesIdsByViews($standard_views_for_data_collection);
174 $user_ids_with_read_right_on_any_standard_view = [];
175 foreach ($roles_ids as $role_id) {
176 $assigned_users = $this->rbac_review->assignedUsers($role_id);
177 if (!empty($assigned_users)) {
178 $user_ids_with_read_right_on_any_standard_view[] = array_merge($user_ids_with_read_right_on_any_standard_view, $assigned_users);
183 if ($this->
in_array_r($this->
user->getId(), $user_ids_with_read_right_on_any_standard_view)) {
198 protected function in_array_r($needle, $haystack, $strict =
false)
200 foreach ($haystack as $item) {
201 if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && $this->
in_array_r($needle, $item, $strict))) {
getStandardViewsByVisibleTables($visible_tables_for_data_collection)
in_array_r($needle, $haystack, $strict=false)
static where($where, $operator=null)
foreach($_POST as $key=> $value) $res
getAllVisibleTablesForDataColleciton()
getRoleTitlesWithoutReadRightOnAnyStandardView()
Create styles array
The data for the language used.
hasUserReadAccessOnAnyVisibleTableView()
getRolesIdsWithReadAccessOnDataCollection()
__construct($obj_id, $ref_id, ilRbacReview $rbac_review, ilObjUser $user, ilDBInterface $database)
ilDclTableHelper constructor.
class ilRbacReview Contains Review functions of core Rbac.