mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 22:21:42 +00:00
Cover all transformers.
This commit is contained in:
@@ -217,6 +217,22 @@ class UserRepository implements UserRepositoryInterface
|
||||
return Role::where('name', $role)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRoleByUser(User $user): ?string
|
||||
{
|
||||
/** @var Role $role */
|
||||
$role = $user->roles()->first();
|
||||
if (null !== $role) {
|
||||
return $role->name;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return basic user information.
|
||||
*
|
||||
|
||||
@@ -31,6 +31,13 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface UserRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRoleByUser(User $user): ?string;
|
||||
/**
|
||||
* Returns a collection of all users.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user