Exemplo n.º 1
0
 /**
  * Resets admin rights on a databox.
  *
  * @param \ACL     $acl
  * @param \databox $databox
  */
 private function doResetAdminRightsOnDatabox(\ACL $acl, \databox $databox)
 {
     $collections = $databox->get_collections();
     $acl->update_rights_to_sbas($databox->get_sbas_id(), ['bas_manage' => '1', 'bas_modify_struct' => '1', 'bas_modif_th' => '1', 'bas_chupub' => '1']);
     $acl->give_access_to_base(array_map(function (\collection $collection) {
         return $collection->get_base_id();
     }, $collections));
     foreach ($collections as $collection) {
         $this->doResetRightsOnCollection($acl, $collection);
     }
 }
Exemplo n.º 2
0
 public function can_see_business_fields(\databox $databox)
 {
     // a user can see the business fields if he has at least the right on one collection to edit a record
     foreach ($databox->get_collections() as $collection) {
         if ($this->has_access_to_base($collection->get_base_id()) && $this->has_right_on_base($collection->get_base_id(), 'canmodifrecord')) {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 3
0
 /**
  * List all available collections for a specified \databox
  *
  * @param  \databox $databox
  *
  * @return array
  */
 private function list_databox_collections(\databox $databox)
 {
     return array_map(function (\collection $collection) {
         return $this->list_collection($collection);
     }, $databox->get_collections());
 }
Exemplo n.º 4
0
 /**
  * List all available collections for a specified databox
  *
  * @param  databox $databox
  * @return array
  */
 protected function list_databox_collections(databox $databox)
 {
     $ret = [];
     foreach ($databox->get_collections() as $collection) {
         $ret[] = $this->list_collection($collection);
     }
     return $ret;
 }