method getSources documentation in bbn\User\Permissions

Returns an array corresponding to the different roots for permissions in the project.

function($only_with_children = true) { $appui = $this->opt->fromCode('appui'); $root = $this->opt->fromCode('permissions', $appui); $access = $this->opt->fromCode('access', $root); $options = $this->opt->fromCode('options', $root); $plugins = $this->opt->fromCode('plugins'); $sources = [[ 'text' => _("Main application"), 'rootAccess' => $access, 'rootOptions' => $options, 'code' => '' ]]; $all = array_merge( array_map( function($a) { $a['code'] = 'appui-'.$a['code']; return $a; }, $this->opt->fullOptions($appui) ), $this->opt->fullOptions($plugins) ); foreach ($all as $o) { if (!empty($o['plugin']) && ($id_perm = $this->opt->fromCode('access', 'permissions', $o['id'])) ) { $id_option = $this->opt->fromCode('options', 'permissions', $o['id']); $tmp = $this->opt->option($id_perm); if (!$only_with_children || !empty($tmp['num_children'])) { $sources[] = [ 'text' => $o['text'], 'code' => $o['code'], 'rootAccess' => $id_perm, 'rootOptions' => $id_option ]; } } } return $sources; }

Returns an array corresponding to the different roots for permissions in the project. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.