57 $roles_ids = $this->getRolesIdsByViews($standard_views_for_data_collection);
62 $roles_with_no_read_right_on_any_standard_view = array_diff($roles_with_read_acces_ids, $roles_ids);
64 $roles_data = $this->rbac_review->getRolesForIDs($roles_with_no_read_right_on_any_standard_view,
true);
66 if (!empty($roles_data)) {
67 foreach ($roles_data as $role_data) {
68 $role_titles[] = $role_data[
'title'];
80 $rbac_roles = $this->rbac_review->getParentRoleIds($this->ref_id);
81 $roles_with_read_acces_ids = [];
83 foreach ($rbac_roles as $role) {
84 $operations = $this->rbac_review->getActiveOperationsOfRole($this->ref_id, $role[
'rol_id']);
86 if (!empty($operations) && in_array(3, $operations)) {
87 $roles_with_read_acces_ids[] = $role[
'rol_id'];
91 return $roles_with_read_acces_ids;
100 protected function getRolesIdsByViews($views_for_data_collection) {
106 foreach ($views_for_data_collection as $key => $view_for_data_collection_array_of_objects) {
107 foreach ($view_for_data_collection_array_of_objects as $view_for_data_collection_object) {
108 $ilDclTableView = ilDclTableView::find($view_for_data_collection_object->getId());
109 $roles_of_view = $ilDclTableView->getRoles();
110 $roles_ids = array_merge($roles_ids, $roles_of_view);
124 $standard_views_for_data_collection = [];
125 foreach ($visible_tables_for_data_collection as $visible_table) {
128 'table_id' => $visible_table[
'id']
133 return $standard_views_for_data_collection;
141 $visible_tables_for_data_collection = [];
142 $res = $this->database->queryF(
143 "SELECT * FROM il_dcl_table WHERE obj_id = %s AND is_visible = 1",
array(
'integer'),
array($this->obj_id)
145 while ($rec = $this->database->fetchAssoc(
$res)) {
146 $visible_tables_for_data_collection[] = $rec;
149 return $visible_tables_for_data_collection;
155 if ($this->
user->getId() == 6) {
162 $roles_ids = $this->getRolesIdsByViews($standard_views_for_data_collection);
164 $user_ids_with_read_right_on_any_standard_view = [];
165 foreach ($roles_ids as $role_id) {
166 $assigned_users = $this->rbac_review->assignedUsers($role_id);
167 if (!empty($assigned_users)) {
168 $user_ids_with_read_right_on_any_standard_view[] = array_merge($user_ids_with_read_right_on_any_standard_view, $assigned_users);
173 if ($this->
in_array_r($this->
user->getId(), $user_ids_with_read_right_on_any_standard_view)) {
188 protected function in_array_r($needle, $haystack, $strict =
false) {
189 foreach ($haystack as $item) {
190 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)
getAllVisibleTablesForDataColleciton()
getRoleTitlesWithoutReadRightOnAnyStandardView()
__construct(int $obj_id, int $ref_id, ilRbacReview $rbac_review, ilObjUser $user, ilDBInterface $database)
ilDclTableHelper constructor.
Create styles array
The data for the language used.
hasUserReadAccessOnAnyVisibleTableView()
getRolesIdsWithReadAccessOnDataCollection()
class ilRbacReview Contains Review functions of core Rbac.