forked from GNUsocial/gnu-social
[COMMON][SECURITY][WRAPPER] Added security service static wrapper and Common::getUser
This commit is contained in:
@@ -32,6 +32,8 @@ namespace App\Util;
|
||||
|
||||
use App\Core\DB\DB;
|
||||
use App\Core\Router;
|
||||
use App\Core\Security;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
abstract class Common
|
||||
{
|
||||
@@ -59,6 +61,11 @@ abstract class Common
|
||||
DB::flush();
|
||||
}
|
||||
|
||||
public static function user(): UserInterface
|
||||
{
|
||||
return Security::getUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the given string identical to a system path or route?
|
||||
* This could probably be put in some other class, but at
|
||||
|
||||
Reference in New Issue
Block a user