app/Module/AbstractModule.php
final public function accessLevel(Tree $tree, string $interface): int
    {
        $access_levels = app('cache.array')
            ->rememberForever('module_privacy' . $tree->id(), static function () use ($tree): Collection {
                return DB::table('module_privacy')
                    ->where('gedcom_id', '=', $tree->id())
                    ->get();
            });

        $row = $access_levels->first(function (stdClass $row) use ($interface): bool {
            return $row->interface === $interface && $row->module_name === $this->name();
        });

        return $row ? (int) $row->access_level : $this->access_level;
    }
final public function accessLevel(Tree $tree, string $interface): int
    {
        $access_levels = app('cache.array')
            ->rememberForever('module_privacy' . $tree->id(), static function () use ($tree): Collection {
                return DB::table('module_privacy')
                    ->where('gedcom_id', '=', $tree->id())
                    ->get();
            });

        $row = $access_levels->first(function (stdClass $row) use ($interface): bool {
            return $row->interface === $interface && $row->module_name === $this->name();
        });

        return $row ? (int) $row->access_level : $this->access_level;
    }
final public function accessLevel ( Tree $ tree , string $ interface ) : int { $ access_levels = app ( 'cache.array' ) -> rememberForever ( 'module_privacy' . $ tree -> id ( ) , static function ( ) use ( $ tree ) : Collection { return DB :: table ( 'module_privacy' ) -> where ( 'gedcom_id' , '=' , $ tree -> id ( ) ) -> get ( ) ; } ) ; $ row = $ access_levels -> first ( function ( stdClass $ row ) use ( $ interface ) : bool { return $ row -> interface === $ interface && $ row -> module_name === $ this -> name ( ) ; } ) ; return $ row ? ( int ) $ row -> access_level : $ this -> access_level ; }
Get a the current access level for a module

@param Tree   $tree
@param string $interface

@return int
Get a the current access level for a module