first commit
This commit is contained in:
58
app/Helpers/Global/user_access_helpers.php
Normal file
58
app/Helpers/Global/user_access_helpers.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
if (! function_exists('user_is_master_admin')) {
|
||||
|
||||
function user_is_master_admin(User $user)
|
||||
{
|
||||
$emails = ['autopilotshorts@gmail.com', 'team@autopilotshorts.com', 'charles@exastellar.com'];
|
||||
$user_id = 1;
|
||||
|
||||
if ($user->id == $user_id) {
|
||||
return true;
|
||||
} elseif (in_array($user->email, $emails)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('user_is_blocked_from_purchase')) {
|
||||
|
||||
function user_is_blocked_from_purchase(User $user)
|
||||
{
|
||||
$emails = ['productionlittlebird@gmail.com'];
|
||||
|
||||
if (in_array($user->email, $emails)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('user_can_generate_demo_videos')) {
|
||||
|
||||
function user_can_generate_demo_videos(User $user)
|
||||
{
|
||||
return user_is_master_admin($user);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('user_is_external_reviewer')) {
|
||||
|
||||
function user_is_external_reviewer(User $user)
|
||||
{
|
||||
$emails = [
|
||||
'shaebaelish.623259@gmail.com',
|
||||
];
|
||||
|
||||
if (in_array($user->email, $emails)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user