mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Fix #3344
This commit is contained in:
14
app/User.php
14
app/User.php
@@ -138,10 +138,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @property-read int|null $transactions_count
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereMfaSecret($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\FireflyIII\User whereObjectguid($value)
|
||||
* @property string $password
|
||||
* @property bool $blocked
|
||||
* @property string|null $blocked_code
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Role[] $roles
|
||||
*/
|
||||
class User extends Authenticatable
|
||||
{
|
||||
@@ -217,6 +213,16 @@ class User extends Authenticatable
|
||||
return $this->hasMany(Attachment::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $role
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasRole(string $role): bool
|
||||
{
|
||||
return $this->roles()->where('name', $role)->count() === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* Link to available budgets
|
||||
|
Reference in New Issue
Block a user