refactor: deprecate isStaffMember; add isVerified
This commit is contained in:
parent
e6f02ce07f
commit
e691e61bb5
25
app/User.php
25
app/User.php
@ -103,16 +103,37 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
|
||||
// UTILITY LOGIC
|
||||
|
||||
public function isStaffMember()
|
||||
public function isVerified(): bool {
|
||||
return !is_null($this->email_verified_at);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if user is staff
|
||||
*
|
||||
* @deprecated This method is being replaced by a better way of checking permissions, rather than checking for group name.
|
||||
* @return bool
|
||||
*/
|
||||
public function isStaffMember(): bool
|
||||
{
|
||||
return $this->hasAnyRole('reviewer', 'admin', 'hiringManager');
|
||||
}
|
||||
|
||||
public function has2FA()
|
||||
/**
|
||||
* Checks if user has 2fa enabled
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has2FA(): bool
|
||||
{
|
||||
return ! is_null($this->twofa_secret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if user has team
|
||||
*
|
||||
* @param $team
|
||||
* @return bool
|
||||
*/
|
||||
public function hasTeam($team): bool
|
||||
{
|
||||
if ($team instanceof Team || is_int($team))
|
||||
|
Loading…
x
Reference in New Issue
Block a user