|
|
@@ -12,62 +12,60 @@ public function __construct(
|
|
|
protected PermissionService $permissionService,
|
|
|
) {}
|
|
|
|
|
|
+ const VIEW = 1;
|
|
|
+ const ADD = 2;
|
|
|
+ const EDIT = 4;
|
|
|
+ const DELETE = 8;
|
|
|
+ const PRINT = 16;
|
|
|
+ const EXPORT = 32;
|
|
|
+ const IMPORT = 64;
|
|
|
+ const LIMIT = 128;
|
|
|
+ const MENU = 256;
|
|
|
+
|
|
|
+ const ALL_PERMS = 511;
|
|
|
+
|
|
|
public function run(): void
|
|
|
{
|
|
|
- // Criação de Permissões
|
|
|
- /*
|
|
|
- view = 1
|
|
|
- add = 2
|
|
|
- edit = 4
|
|
|
- delete = 8
|
|
|
- print = 16
|
|
|
- export = 32
|
|
|
- import = 64
|
|
|
- limit = 128
|
|
|
- menu = 256
|
|
|
-
|
|
|
- para cada cada bit selecionado se faz a soma dos valores.
|
|
|
- */
|
|
|
$permissions = [
|
|
|
[
|
|
|
"scope" => "dashboard",
|
|
|
"description" => "Dashboard",
|
|
|
- "bits" => 511,
|
|
|
+ "bits" => self::ALL_PERMS,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config",
|
|
|
"description" => "Configurações",
|
|
|
- "bits" => 271,
|
|
|
+ "bits" => self::MENU,
|
|
|
"children" => [
|
|
|
[
|
|
|
"scope" => "config.user",
|
|
|
"description" => "Configurações de Usuários",
|
|
|
- "bits" => 271,
|
|
|
+ "bits" => self::MENU | self::VIEW | self::ADD | self::EDIT | self::DELETE,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config.permission",
|
|
|
"description" => "Configurações de Permissões",
|
|
|
- "bits" => 271,
|
|
|
+ "bits" => self::MENU | self::VIEW | self::ADD | self::EDIT | self::DELETE,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config.city",
|
|
|
"description" => "Configurações de Cidades",
|
|
|
- "bits" => 271,
|
|
|
+ "bits" => self::MENU | self::VIEW | self::ADD | self::EDIT | self::DELETE,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config.country",
|
|
|
"description" => "Configurações de Países",
|
|
|
- "bits" => 271,
|
|
|
+ "bits" => self::MENU | self::VIEW | self::ADD | self::EDIT | self::DELETE,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config.state",
|
|
|
"description" => "Configurações de Estados",
|
|
|
- "bits" => 271,
|
|
|
+ "bits" => self::MENU | self::VIEW | self::ADD | self::EDIT | self::DELETE,
|
|
|
"children" => [],
|
|
|
],
|
|
|
],
|