Przeglądaj źródła

Merge branch 'feat/GINC-GAB-cadastro-unidades' of Softpar/sfp_api_laravel_ginastica_cerebro into development

Gabriel Alves 2 tygodni temu
rodzic
commit
5175680b75

+ 1 - 1
app/Traits/HasPermissions.php

@@ -15,7 +15,7 @@ public function hasPermission(string $scope, string $accessType): bool
         if ($requiredBit === 0) return false;
 
         $service = App::make(UserTypePermissionService::class);
-        $permissions = $service->allPermissionsByUserType($this->type);
+        $permissions = $service->allPermissionsByUserType($this->user_type);
         $perm = $permissions->first(fn($p) => $p->permission->scope === $scope);
 
         return $perm && ($perm->bits & $requiredBit);

+ 6 - 0
database/seeders/PermissionSeeder.php

@@ -21,6 +21,12 @@ public function run(): void
                 "bits" => Permission::ALL_PERMS,
                 "children" => [],
             ],
+            [
+                "scope" => "franchisee",
+                "description" => "Franchisee",
+                "bits" => Permission::ALL_PERMS,
+                "children" => [],
+            ],
             [
                 "scope" => "config",
                 "description" => "Configurações",