mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Fixes #7175
This commit is contained in:
@@ -119,6 +119,15 @@ class UserRepository implements UserRepositoryInterface
|
||||
return Role::create(['name' => $name, 'display_name' => $displayName, 'description' => $description]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function deleteInvite(InvitedUser $invite): void
|
||||
{
|
||||
Log::debug(sprintf('Deleting invite #%d', $invite->id));
|
||||
$invite->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
@@ -286,24 +295,24 @@ class UserRepository implements UserRepositoryInterface
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasRole(User|Authenticatable|null $user, string $role): bool
|
||||
{
|
||||
if (null === $user) {
|
||||
return false;
|
||||
}
|
||||
/** @var Role $userRole */
|
||||
foreach ($user->roles as $userRole) {
|
||||
if ($userRole->name === $role) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function hasRole(User|Authenticatable|null $user, string $role): bool
|
||||
{
|
||||
if (null === $user) {
|
||||
return false;
|
||||
}
|
||||
/** @var Role $userRole */
|
||||
foreach ($user->roles as $userRole) {
|
||||
if ($userRole->name === $role) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function inviteUser(User|Authenticatable|null $user, string $email): InvitedUser
|
||||
{
|
||||
$now = today(config('app.timezone'));
|
||||
|
@@ -102,6 +102,12 @@ interface UserRepositoryInterface
|
||||
*/
|
||||
public function deleteEmptyGroups(): void;
|
||||
|
||||
/**
|
||||
* @param InvitedUser $invite
|
||||
* @return void
|
||||
*/
|
||||
public function deleteInvite(InvitedUser $invite): void;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
*
|
||||
|
Reference in New Issue
Block a user