Update Kirby and dependencies

This commit is contained in:
Paul Nicoué 2022-06-17 18:02:55 +02:00
parent 750b9cc83e
commit 8c71a258b6
59 changed files with 2143 additions and 813 deletions

View file

@ -97,14 +97,20 @@ class Roles extends Collection
*/
public static function load(string $root = null, array $inject = [])
{
$kirby = App::instance();
$roles = new static();
// load roles from plugins
foreach (App::instance()->extensions('blueprints') as $blueprintName => $blueprint) {
foreach ($kirby->extensions('blueprints') as $blueprintName => $blueprint) {
if (substr($blueprintName, 0, 6) !== 'users/') {
continue;
}
// callback option can be return array or blueprint file path
if (is_callable($blueprint) === true) {
$blueprint = $blueprint($kirby);
}
if (is_array($blueprint) === true) {
$role = Role::factory($blueprint, $inject);
} else {