|
@@ -72,6 +72,9 @@ class UserTypePermissionSeeder extends Seeder
|
|
|
['scope' => 'config.service_type', 'bits' => 1],
|
|
['scope' => 'config.service_type', 'bits' => 1],
|
|
|
['scope' => 'config.schedule', 'bits' => 271],
|
|
['scope' => 'config.schedule', 'bits' => 271],
|
|
|
['scope' => 'config.custom_schedule', 'bits' => 271],
|
|
['scope' => 'config.custom_schedule', 'bits' => 271],
|
|
|
|
|
+ ['scope' => 'config.improvement_type', 'bits' => 1],
|
|
|
|
|
+ ['scope' => 'config.review', 'bits' => 271],
|
|
|
|
|
+ ['scope' => 'config.provider_client_block', 'bits' => 9],
|
|
|
];
|
|
];
|
|
|
$this->seedUserTypePermissions($providerPermissions, UserTypeEnum::PROVIDER->value);
|
|
$this->seedUserTypePermissions($providerPermissions, UserTypeEnum::PROVIDER->value);
|
|
|
break;
|
|
break;
|
|
@@ -87,7 +90,9 @@ class UserTypePermissionSeeder extends Seeder
|
|
|
['scope' => 'config.client_payment_method', 'bits' => 271],
|
|
['scope' => 'config.client_payment_method', 'bits' => 271],
|
|
|
['scope' => 'config.provider_working_day', 'bits' => 271],
|
|
['scope' => 'config.provider_working_day', 'bits' => 271],
|
|
|
['scope' => 'config.provider_blocked_day', 'bits' => 271],
|
|
['scope' => 'config.provider_blocked_day', 'bits' => 271],
|
|
|
|
|
+ ['scope' => 'config.improvement_type', 'bits' => 1],
|
|
|
['scope' => 'config.review', 'bits' => 271],
|
|
['scope' => 'config.review', 'bits' => 271],
|
|
|
|
|
+ ['scope' => 'config.client_provider_block', 'bits' => 9],
|
|
|
['scope' => 'config.schedule', 'bits' => 271],
|
|
['scope' => 'config.schedule', 'bits' => 271],
|
|
|
['scope' => 'config.custom_schedule', 'bits' => 271],
|
|
['scope' => 'config.custom_schedule', 'bits' => 271],
|
|
|
['scope' => 'config.speciality', 'bits' => 271],
|
|
['scope' => 'config.speciality', 'bits' => 271],
|
|
@@ -104,12 +109,15 @@ class UserTypePermissionSeeder extends Seeder
|
|
|
foreach ($permissions as $permissionData) {
|
|
foreach ($permissions as $permissionData) {
|
|
|
$permission = Permission::where('scope', $permissionData['scope'])->first();
|
|
$permission = Permission::where('scope', $permissionData['scope'])->first();
|
|
|
if ($permission) {
|
|
if ($permission) {
|
|
|
- $userTypePermission = UserTypePermission::firstOrNew([
|
|
|
|
|
- 'user_type' => $userType,
|
|
|
|
|
- 'permission_id' => $permission->id,
|
|
|
|
|
- 'bits' => $permissionData['bits'],
|
|
|
|
|
- ]);
|
|
|
|
|
- $userTypePermission->save();
|
|
|
|
|
|
|
+ UserTypePermission::updateOrCreate(
|
|
|
|
|
+ [
|
|
|
|
|
+ 'user_type' => $userType,
|
|
|
|
|
+ 'permission_id' => $permission->id,
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'bits' => $permissionData['bits'],
|
|
|
|
|
+ ]
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|