Skip to content

Commit

Permalink
update superadmin method
Browse files Browse the repository at this point in the history
  • Loading branch information
priscillay-toast authored Oct 17, 2023
1 parent 2fd2fcf commit a7ac02a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Helpers/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ static function isSuperAdmin()
{
if ($defaultUser = Environment::getEnv('SS_DEFAULT_ADMIN_USERNAME')) {
if ($currentUser = Security::getCurrentUser()) {
return $currentUser->Email == $defaultUser;
// all toast email owner is a superadmin
return $currentUser->Email == $defaultUser || strstr($currentUser->Email, '@toast.co.nz');
}
}
// all toast email owner is a superadmin
if ($currentUser = Security::getCurrentUser()) {
return strstr($currentUser->Email, '@toast.co.nz');
}
return false;
}

Expand Down

0 comments on commit a7ac02a

Please sign in to comment.