diff --git a/app/User.php b/app/User.php index 59cc9b4..52ce4a7 100755 --- a/app/User.php +++ b/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))