|
|
@@ -23,7 +23,7 @@ public function run(): void
|
|
|
],
|
|
|
[
|
|
|
"scope" => "franchisee",
|
|
|
- "description" => "Franchisee",
|
|
|
+ "description" => "Franqueados",
|
|
|
"bits" => Permission::MENU | Permission::VIEW,
|
|
|
"children" => [
|
|
|
[
|
|
|
@@ -32,8 +32,15 @@ public function run(): void
|
|
|
"bits" => Permission::ALL_PERMS,
|
|
|
"children" => [],
|
|
|
],
|
|
|
+ [
|
|
|
+ "scope" => "franchisee-unit",
|
|
|
+ "description" => "Unidades do Franqueado",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
],
|
|
|
],
|
|
|
+ // Pacotes / Aulas
|
|
|
[
|
|
|
"scope" => "class-package",
|
|
|
"description" => "Pacotes (Franqueadora)",
|
|
|
@@ -46,6 +53,57 @@ public function run(): void
|
|
|
"bits" => Permission::ALL_PERMS,
|
|
|
"children" => [],
|
|
|
],
|
|
|
+ [
|
|
|
+ "scope" => "class-package-franchisee",
|
|
|
+ "description" => "Pacotes (Franqueado)",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "class",
|
|
|
+ "description" => "Aulas",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "class-attendance",
|
|
|
+ "description" => "Frequência de Aulas",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "modality",
|
|
|
+ "description" => "Modalidades",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ // Alunos
|
|
|
+ [
|
|
|
+ "scope" => "student",
|
|
|
+ "description" => "Alunos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "student-history",
|
|
|
+ "description" => "Histórico de Alunos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "student-media",
|
|
|
+ "description" => "Mídias de Alunos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "student-responsible",
|
|
|
+ "description" => "Responsáveis de Alunos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
[
|
|
|
"scope" => "student-contract",
|
|
|
"description" => "Contratos de Alunos",
|
|
|
@@ -54,10 +112,216 @@ public function run(): void
|
|
|
],
|
|
|
[
|
|
|
"scope" => "media",
|
|
|
- "description" => "Mídias de Alunos",
|
|
|
+ "description" => "Mídias",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ // Kanban
|
|
|
+ [
|
|
|
+ "scope" => "kanban",
|
|
|
+ "description" => "Kanban",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "kanban-status",
|
|
|
+ "description" => "Status do Kanban",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "kanban-movement",
|
|
|
+ "description" => "Movimentos do Kanban",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ // Suporte
|
|
|
+ [
|
|
|
+ "scope" => "support-ticket",
|
|
|
+ "description" => "Chamados de Suporte",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "support-status",
|
|
|
+ "description" => "Status de Suporte",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "support-movement",
|
|
|
+ "description" => "Movimentos de Suporte",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ // Notificações
|
|
|
+ [
|
|
|
+ "scope" => "notification",
|
|
|
+ "description" => "Notificações",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "notification-recipient",
|
|
|
+ "description" => "Destinatários de Notificações",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ // Produtos / Inventário
|
|
|
+ [
|
|
|
+ "scope" => "product",
|
|
|
+ "description" => "Produtos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "product-kit",
|
|
|
+ "description" => "Kits de Produtos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "product-movement",
|
|
|
+ "description" => "Movimentação de Produtos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "product-order",
|
|
|
+ "description" => "Pedidos de Produtos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "product-order-item",
|
|
|
+ "description" => "Itens de Pedido de Produtos",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "franchisor-inventory",
|
|
|
+ "description" => "Estoque (Franqueadora)",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "franchisee-inventory",
|
|
|
+ "description" => "Estoque (Franqueado)",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ // Fornecedores / Pagamentos
|
|
|
+ [
|
|
|
+ "scope" => "supplier",
|
|
|
+ "description" => "Fornecedores",
|
|
|
"bits" => Permission::ALL_PERMS,
|
|
|
"children" => [],
|
|
|
],
|
|
|
+ [
|
|
|
+ "scope" => "payment-method",
|
|
|
+ "description" => "Formas de Pagamento",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ // Financeiro
|
|
|
+ [
|
|
|
+ "scope" => "financial",
|
|
|
+ "description" => "Financeiro",
|
|
|
+ "bits" => Permission::MENU | Permission::VIEW,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "financial-account-payable",
|
|
|
+ "description" => "Contas a Pagar",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "financial-account-receive",
|
|
|
+ "description" => "Contas a Receber",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "financial-invoice",
|
|
|
+ "description" => "Notas Fiscais",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "financial-plan-account",
|
|
|
+ "description" => "Plano de Contas",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ // Tesouraria
|
|
|
+ [
|
|
|
+ "scope" => "treasury",
|
|
|
+ "description" => "Tesouraria",
|
|
|
+ "bits" => Permission::MENU | Permission::VIEW,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "treasury-account",
|
|
|
+ "description" => "Contas de Tesouraria",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "treasury-imports",
|
|
|
+ "description" => "Importações de Tesouraria",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "treasury-import-line",
|
|
|
+ "description" => "Linhas de Importação",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "treasury-launch",
|
|
|
+ "description" => "Lançamentos de Tesouraria",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ // Integrações
|
|
|
+ [
|
|
|
+ "scope" => "integrations",
|
|
|
+ "description" => "Integrações",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "integration-variable",
|
|
|
+ "description" => "Variáveis de Integração",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ // Feriados
|
|
|
+ [
|
|
|
+ "scope" => "holiday",
|
|
|
+ "description" => "Feriados",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [
|
|
|
+ [
|
|
|
+ "scope" => "base-holiday",
|
|
|
+ "description" => "Feriados Base",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ // TBR
|
|
|
[
|
|
|
"scope" => "tbr",
|
|
|
"description" => "TBR",
|
|
|
@@ -87,6 +351,24 @@ public function run(): void
|
|
|
"bits" => Permission::ALL_PERMS,
|
|
|
"children" => [],
|
|
|
],
|
|
|
+ [
|
|
|
+ "scope" => "franchisee-royalties-bracket",
|
|
|
+ "description" => "Faixas de Royalties do Franqueado",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "franchisee-fnm-bracket",
|
|
|
+ "description" => "Faixas de FNM do Franqueado",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "franchisee-maintenance-bracket",
|
|
|
+ "description" => "Faixas de Manutenção do Franqueado",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
[
|
|
|
"scope" => "tbr-calculation",
|
|
|
"description" => "Cálculo de TBR",
|
|
|
@@ -107,6 +389,7 @@ public function run(): void
|
|
|
],
|
|
|
],
|
|
|
],
|
|
|
+ // Configurações
|
|
|
[
|
|
|
"scope" => "config",
|
|
|
"description" => "Configurações",
|
|
|
@@ -114,36 +397,49 @@ public function run(): void
|
|
|
"children" => [
|
|
|
[
|
|
|
"scope" => "config.user",
|
|
|
- "description" => "Configurações de Usuários",
|
|
|
+ "description" => "Usuários",
|
|
|
+ "bits" => Permission::CRUD,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ "scope" => "config.user-type",
|
|
|
+ "description" => "Tipos de Usuário",
|
|
|
"bits" => Permission::CRUD,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config.permission",
|
|
|
- "description" => "Configurações de Permissões",
|
|
|
+ "description" => "Permissões",
|
|
|
"bits" => Permission::CRUD,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config.city",
|
|
|
- "description" => "Configurações de Cidades",
|
|
|
+ "description" => "Cidades",
|
|
|
"bits" => Permission::CRUD,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config.country",
|
|
|
- "description" => "Configurações de Países",
|
|
|
+ "description" => "Países",
|
|
|
"bits" => Permission::CRUD,
|
|
|
"children" => [],
|
|
|
],
|
|
|
[
|
|
|
"scope" => "config.state",
|
|
|
- "description" => "Configurações de Estados",
|
|
|
+ "description" => "Estados",
|
|
|
"bits" => Permission::CRUD,
|
|
|
"children" => [],
|
|
|
],
|
|
|
],
|
|
|
],
|
|
|
+ // Unidade — escopos adicionais usados em subrotas de unit
|
|
|
+ [
|
|
|
+ "scope" => "unit-user",
|
|
|
+ "description" => "Usuários da Unidade",
|
|
|
+ "bits" => Permission::ALL_PERMS,
|
|
|
+ "children" => [],
|
|
|
+ ],
|
|
|
];
|
|
|
|
|
|
$this->createPermissionsAndChildren(permissions: $permissions);
|
|
|
@@ -151,9 +447,6 @@ public function run(): void
|
|
|
|
|
|
/**
|
|
|
* Recursively creates or updates permissions and handles nesting.
|
|
|
- *
|
|
|
- * @param array $permissions The array of permission data.
|
|
|
- * @param Permission|null $parent The parent Permission object (for nested sets).
|
|
|
*/
|
|
|
private function createPermissionsAndChildren(
|
|
|
array $permissions,
|