@telos-dev-team/dealernode-permissions 1.1.57 → 1.1.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backoffice-permissions.d.ts +35 -3
- package/dist/backoffice-permissions.js +33 -0
- package/package.json +4 -1
- package/.github/workflows/publish.yml +0 -37
- package/gps-provider-permissions.md +0 -109
- package/src/backoffice-permissions.ts +0 -169
- package/src/index.ts +0 -7
- package/src/permissions.ts +0 -884
- package/tsconfig.json +0 -12
|
@@ -118,6 +118,38 @@ export declare const BACKOFFICE_PERMISSIONS: {
|
|
|
118
118
|
*/
|
|
119
119
|
readonly CREDENTIALS: "backoffice.billing.credentials";
|
|
120
120
|
};
|
|
121
|
+
/**
|
|
122
|
+
* Payment integrations of any dealer from the backoffice (dealernode-backend
|
|
123
|
+
* `src/payment`): list its Stripe, Clover, iPOS and BMS accounts, connect and
|
|
124
|
+
* disconnect them, manage terminals and readers, and assign capabilities to
|
|
125
|
+
* each account. Not PAYMENTS (what a dealer charges its own buyers) and not
|
|
126
|
+
* BILLING (what the platform charges the dealer).
|
|
127
|
+
*/
|
|
128
|
+
readonly DEALER_INTEGRATIONS: {
|
|
129
|
+
readonly VIEW: "backoffice.dealer_integrations.view";
|
|
130
|
+
readonly MANAGE: "backoffice.dealer_integrations.manage";
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Emails the system sent, read-only, across every dealer (dealernode-backend
|
|
134
|
+
* `src/email`): list them with their delivery status (sent, delivered,
|
|
135
|
+
* opened, bounced, spam complaint, failed) and open one to see its content
|
|
136
|
+
* and timeline. No MANAGE — the backoffice never sends or edits these, it
|
|
137
|
+
* only audits what the platform already sent.
|
|
138
|
+
*/
|
|
139
|
+
readonly EMAILS: {
|
|
140
|
+
readonly VIEW: "backoffice.emails.view";
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* A dealer's notification configuration from the backoffice
|
|
144
|
+
* (dealernode-backend `dealer_notification_config`): the email addresses that
|
|
145
|
+
* receive payment, refund and dispute receipts, plus the payment-reminder
|
|
146
|
+
* lead times (first bank payment, pickup, BHPH). Not the per-type notification
|
|
147
|
+
* routing (`notification_routing`) — that is its own concern.
|
|
148
|
+
*/
|
|
149
|
+
readonly DEALER_NOTIFICATIONS: {
|
|
150
|
+
readonly VIEW: "backoffice.dealer_notifications.view";
|
|
151
|
+
readonly MANAGE: "backoffice.dealer_notifications.manage";
|
|
152
|
+
};
|
|
121
153
|
};
|
|
122
154
|
export type BackofficePermission = typeof BACKOFFICE_PERMISSIONS;
|
|
123
155
|
/**
|
|
@@ -137,10 +169,10 @@ export type BackofficePermissionId = Leaves<BackofficePermission>;
|
|
|
137
169
|
*/
|
|
138
170
|
export declare const BACKOFFICE_PERMISSION_PRESETS: {
|
|
139
171
|
/** Every `*.view` permission, nothing else. */
|
|
140
|
-
readonly READ_ONLY: ("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials")[];
|
|
172
|
+
readonly READ_ONLY: ("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage")[];
|
|
141
173
|
/** Read-only plus the two areas support routinely needs to act on. */
|
|
142
|
-
readonly SUPPORT: readonly [...("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials")[], "backoffice.dealers.manage", "backoffice.dealer_resources.manage", "backoffice.dealer_relationships.manage"];
|
|
174
|
+
readonly SUPPORT: readonly [...("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage")[], "backoffice.dealers.manage", "backoffice.dealer_resources.manage", "backoffice.dealer_relationships.manage", "backoffice.dealer_integrations.manage"];
|
|
143
175
|
/** Every backoffice permission. */
|
|
144
|
-
readonly ADMIN: ("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials")[];
|
|
176
|
+
readonly ADMIN: ("backoffice.dealers.view" | "backoffice.dealers.manage" | "backoffice.users.view" | "backoffice.users.manage" | "backoffice.permissions.manage" | "backoffice.payments.view" | "backoffice.payments.manage" | "backoffice.dealer_resources.view" | "backoffice.dealer_resources.manage" | "backoffice.catalog.view" | "backoffice.catalog.manage" | "backoffice.dealer_roles.view" | "backoffice.dealer_roles.manage" | "backoffice.dealer_members.view" | "backoffice.dealer_members.manage" | "backoffice.dealer_relationships.view" | "backoffice.dealer_relationships.manage" | "backoffice.dealer_groups.view" | "backoffice.dealer_groups.manage" | "backoffice.workflows.view" | "backoffice.workflows.manage" | "backoffice.billing.view" | "backoffice.billing.manage" | "backoffice.billing.credentials" | "backoffice.dealer_integrations.view" | "backoffice.dealer_integrations.manage" | "backoffice.emails.view" | "backoffice.dealer_notifications.view" | "backoffice.dealer_notifications.manage")[];
|
|
145
177
|
};
|
|
146
178
|
export {};
|
|
@@ -121,6 +121,38 @@ exports.BACKOFFICE_PERMISSIONS = {
|
|
|
121
121
|
*/
|
|
122
122
|
CREDENTIALS: "backoffice.billing.credentials",
|
|
123
123
|
},
|
|
124
|
+
/**
|
|
125
|
+
* Payment integrations of any dealer from the backoffice (dealernode-backend
|
|
126
|
+
* `src/payment`): list its Stripe, Clover, iPOS and BMS accounts, connect and
|
|
127
|
+
* disconnect them, manage terminals and readers, and assign capabilities to
|
|
128
|
+
* each account. Not PAYMENTS (what a dealer charges its own buyers) and not
|
|
129
|
+
* BILLING (what the platform charges the dealer).
|
|
130
|
+
*/
|
|
131
|
+
DEALER_INTEGRATIONS: {
|
|
132
|
+
VIEW: "backoffice.dealer_integrations.view",
|
|
133
|
+
MANAGE: "backoffice.dealer_integrations.manage",
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* Emails the system sent, read-only, across every dealer (dealernode-backend
|
|
137
|
+
* `src/email`): list them with their delivery status (sent, delivered,
|
|
138
|
+
* opened, bounced, spam complaint, failed) and open one to see its content
|
|
139
|
+
* and timeline. No MANAGE — the backoffice never sends or edits these, it
|
|
140
|
+
* only audits what the platform already sent.
|
|
141
|
+
*/
|
|
142
|
+
EMAILS: {
|
|
143
|
+
VIEW: "backoffice.emails.view",
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* A dealer's notification configuration from the backoffice
|
|
147
|
+
* (dealernode-backend `dealer_notification_config`): the email addresses that
|
|
148
|
+
* receive payment, refund and dispute receipts, plus the payment-reminder
|
|
149
|
+
* lead times (first bank payment, pickup, BHPH). Not the per-type notification
|
|
150
|
+
* routing (`notification_routing`) — that is its own concern.
|
|
151
|
+
*/
|
|
152
|
+
DEALER_NOTIFICATIONS: {
|
|
153
|
+
VIEW: "backoffice.dealer_notifications.view",
|
|
154
|
+
MANAGE: "backoffice.dealer_notifications.manage",
|
|
155
|
+
},
|
|
124
156
|
};
|
|
125
157
|
function flatten(node) {
|
|
126
158
|
const values = [];
|
|
@@ -152,6 +184,7 @@ exports.BACKOFFICE_PERMISSION_PRESETS = {
|
|
|
152
184
|
exports.BACKOFFICE_PERMISSIONS.DEALERS.MANAGE,
|
|
153
185
|
exports.BACKOFFICE_PERMISSIONS.DEALER_RESOURCES.MANAGE,
|
|
154
186
|
exports.BACKOFFICE_PERMISSIONS.DEALER_RELATIONSHIPS.MANAGE,
|
|
187
|
+
exports.BACKOFFICE_PERMISSIONS.DEALER_INTEGRATIONS.MANAGE,
|
|
155
188
|
],
|
|
156
189
|
/** Every backoffice permission. */
|
|
157
190
|
ADMIN: ALL_BACKOFFICE_PERMISSIONS,
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telos-dev-team/dealernode-permissions",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.59",
|
|
4
4
|
"description": "Shared permissions constants for dealernode projects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
7
10
|
"publishConfig": {
|
|
8
11
|
"access": "public"
|
|
9
12
|
},
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
name: Publish to npm
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
publish:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
permissions:
|
|
11
|
-
contents: write
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
with:
|
|
16
|
-
fetch-depth: 0
|
|
17
|
-
|
|
18
|
-
- uses: actions/setup-node@v4
|
|
19
|
-
with:
|
|
20
|
-
node-version: 22
|
|
21
|
-
registry-url: https://registry.npmjs.org
|
|
22
|
-
|
|
23
|
-
- run: npm ci
|
|
24
|
-
|
|
25
|
-
- name: Bump version and publish
|
|
26
|
-
env:
|
|
27
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
28
|
-
run: |
|
|
29
|
-
git config user.name "github-actions[bot]"
|
|
30
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
31
|
-
npm version patch --no-git-tag-version
|
|
32
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
33
|
-
npm publish
|
|
34
|
-
git add package.json package-lock.json
|
|
35
|
-
git commit -m "chore: release v${VERSION}"
|
|
36
|
-
git tag "v${VERSION}"
|
|
37
|
-
git push && git push --tags
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# GPS Provider — Permisos a agregar al paquete común
|
|
2
|
-
|
|
3
|
-
Este documento define los permisos del módulo `gps-provider` para integrarlos al
|
|
4
|
-
paquete `@telos-dev-team/dealernode-permissions` (la fuente de verdad de
|
|
5
|
-
permisos de DealerNode). Una vez agregados y publicada una nueva versión del
|
|
6
|
-
paquete, `dealernode-backend` los importa desde `PERMISSIONS.GPS_PROVIDER.*` y
|
|
7
|
-
los persiste en DB con `npm run sync:permissions`.
|
|
8
|
-
|
|
9
|
-
## Bloque TypeScript a agregar en `src/permissions.ts`
|
|
10
|
-
|
|
11
|
-
Insertar como un top-level más del objeto `PERMISSIONS` (mismo nivel que
|
|
12
|
-
`DEAL`, `CAR`, `PAYMENT`, etc.):
|
|
13
|
-
|
|
14
|
-
```ts
|
|
15
|
-
GPS_PROVIDER: {
|
|
16
|
-
CONFIG: {
|
|
17
|
-
OPERATIONS: {
|
|
18
|
-
CREATE: 'gps-provider.config.operations.create',
|
|
19
|
-
VIEW: 'gps-provider.config.operations.view',
|
|
20
|
-
UPDATE: 'gps-provider.config.operations.update',
|
|
21
|
-
DELETE: 'gps-provider.config.operations.delete',
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
DEVICE: {
|
|
25
|
-
OPERATIONS: {
|
|
26
|
-
VIEW: 'gps-provider.device.operations.view',
|
|
27
|
-
LOCATE: 'gps-provider.device.operations.locate',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Total: **6 permisos nuevos**.
|
|
34
|
-
|
|
35
|
-
### Naming
|
|
36
|
-
|
|
37
|
-
Sigue la convención existente del paquete: `module.resource.operations.action`,
|
|
38
|
-
con `kebab-case` en el slug del módulo cuando lleva guión (como ya hace el
|
|
39
|
-
paquete para `connected-account`).
|
|
40
|
-
|
|
41
|
-
### Por qué dos sub-recursos (`CONFIG` y `DEVICE`)
|
|
42
|
-
|
|
43
|
-
- `CONFIG` controla quién puede administrar la configuración del proveedor GPS
|
|
44
|
-
por dealer (credenciales, nombre, tipo de proveedor). Es un recurso CRUD
|
|
45
|
-
clásico → 4 acciones.
|
|
46
|
-
- `DEVICE` controla quién puede consultar dispositivos GPS contra el proveedor
|
|
47
|
-
externo. Se separa en dos por costo:
|
|
48
|
-
- `VIEW` cubre las lecturas (location, history, status, info, mileage,
|
|
49
|
-
alerts, active, search).
|
|
50
|
-
- `LOCATE` controla el único endpoint que **dispara un ping on-demand al
|
|
51
|
-
dispositivo** (`POST /gps-provider/devices/:imei/locate`), que consume cuota
|
|
52
|
-
del proveedor. Tiene sentido restringirlo aparte.
|
|
53
|
-
|
|
54
|
-
## Mapeo endpoint → permiso
|
|
55
|
-
|
|
56
|
-
| Controller / Método | HTTP | Permiso |
|
|
57
|
-
|---|---|---|
|
|
58
|
-
| `DealerGpsConfigController.create` | `POST /gps-provider/config` | `GPS_PROVIDER.CONFIG.OPERATIONS.CREATE` |
|
|
59
|
-
| `DealerGpsConfigController.findAllByDealer` | `GET /gps-provider/config` | `GPS_PROVIDER.CONFIG.OPERATIONS.VIEW` |
|
|
60
|
-
| `DealerGpsConfigController.findById` | `GET /gps-provider/config/:configId` | `GPS_PROVIDER.CONFIG.OPERATIONS.VIEW` |
|
|
61
|
-
| `DealerGpsConfigController.update` | `PUT /gps-provider/config/:configId` | `GPS_PROVIDER.CONFIG.OPERATIONS.UPDATE` |
|
|
62
|
-
| `DealerGpsConfigController.delete` | `DELETE /gps-provider/config/:configId` | `GPS_PROVIDER.CONFIG.OPERATIONS.DELETE` |
|
|
63
|
-
| `GpsDeviceController.findByImei` | `GET /gps-provider/devices/search` | `GPS_PROVIDER.DEVICE.OPERATIONS.VIEW` |
|
|
64
|
-
| `GpsDeviceController.getDeviceLocation` | `GET /gps-provider/devices/:imei/location` | `GPS_PROVIDER.DEVICE.OPERATIONS.VIEW` |
|
|
65
|
-
| `GpsDeviceController.locateDeviceNow` | `POST /gps-provider/devices/:imei/locate` | `GPS_PROVIDER.DEVICE.OPERATIONS.LOCATE` |
|
|
66
|
-
| `GpsDeviceController.getDeviceHistory` | `GET /gps-provider/devices/:imei/history` | `GPS_PROVIDER.DEVICE.OPERATIONS.VIEW` |
|
|
67
|
-
| `GpsDeviceController.getDeviceStatus` | `GET /gps-provider/devices/:imei/status` | `GPS_PROVIDER.DEVICE.OPERATIONS.VIEW` |
|
|
68
|
-
| `GpsDeviceController.getDeviceInfo` | `GET /gps-provider/devices/:imei/info` | `GPS_PROVIDER.DEVICE.OPERATIONS.VIEW` |
|
|
69
|
-
| `GpsDeviceController.getDeviceMileage` | `GET /gps-provider/devices/:imei/mileage` | `GPS_PROVIDER.DEVICE.OPERATIONS.VIEW` |
|
|
70
|
-
| `GpsDeviceController.getDeviceAlerts` | `GET /gps-provider/devices/:imei/alerts` | `GPS_PROVIDER.DEVICE.OPERATIONS.VIEW` |
|
|
71
|
-
| `GpsDeviceController.isDeviceActive` | `GET /gps-provider/devices/:imei/active` | `GPS_PROVIDER.DEVICE.OPERATIONS.VIEW` |
|
|
72
|
-
|
|
73
|
-
## Estado anterior (qué se reemplaza)
|
|
74
|
-
|
|
75
|
-
Antes de esta integración, los endpoints del módulo dependían de permisos
|
|
76
|
-
prestados o no validaban:
|
|
77
|
-
|
|
78
|
-
- `POST/PUT /gps-provider/config` usaba `DEALER.OPERATIONS.UPDATE`.
|
|
79
|
-
- `DELETE /gps-provider/config/:id` usaba `DEALER.OPERATIONS.DELETE`.
|
|
80
|
-
- `GET /gps-provider/config` y `GET /gps-provider/config/:id` **no validaban
|
|
81
|
-
permiso alguno** (sólo JWT + filtro por `dealerId`).
|
|
82
|
-
- Los 9 endpoints de `GpsDeviceController` usaban `CAR.GPS.OPERATIONS.VIEW`
|
|
83
|
-
(prestado del módulo `car`), sin distinguir `locate` de lecturas pasivas.
|
|
84
|
-
|
|
85
|
-
## Pasos de release
|
|
86
|
-
|
|
87
|
-
1. **Repo del paquete `@telos-dev-team/dealernode-permissions`**: pegar el
|
|
88
|
-
bloque `GPS_PROVIDER` en `src/permissions.ts`, abrir PR, bumpear versión
|
|
89
|
-
(minor: `1.x.0`), publicar.
|
|
90
|
-
2. **dealernode-backend**:
|
|
91
|
-
- `npm install @telos-dev-team/dealernode-permissions@<nueva-versión>` y
|
|
92
|
-
commitear `package.json` + lockfile.
|
|
93
|
-
- Aplicar los reemplazos en commands y queries del módulo gps-provider
|
|
94
|
-
(los 14 endpoints, ver tabla de arriba).
|
|
95
|
-
3. **Deploy**.
|
|
96
|
-
4. **Post-deploy**: correr `npm run sync:permissions` contra el ambiente para
|
|
97
|
-
crear los 6 permisos nuevos en la tabla `permission`. El script es
|
|
98
|
-
idempotente y debe imprimir `6 created, 0 deleted`.
|
|
99
|
-
5. **Operativo**: asignar los nuevos permisos a los roles correspondientes
|
|
100
|
-
(super_admin, dealer_admin, manager según política). No se hace por código.
|
|
101
|
-
|
|
102
|
-
## Notas
|
|
103
|
-
|
|
104
|
-
- No se elimina ningún permiso existente; los `CAR.GPS.OPERATIONS.*` y
|
|
105
|
-
`DEAL.GPS.OPERATIONS.*` siguen siendo válidos para sus propios módulos
|
|
106
|
-
(`car`/`deal`). Sólo se deja de **reusarlos** desde `gps-provider`.
|
|
107
|
-
- Si en el futuro hace falta granularidad adicional para device (p. ej.
|
|
108
|
-
separar `VIEW_HISTORY` o `VIEW_ALERTS`), se agrega como una nueva acción
|
|
109
|
-
bajo `GPS_PROVIDER.DEVICE.OPERATIONS` sin romper compatibilidad.
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Backoffice realm — a separate, flat catalog from `PERMISSIONS`.
|
|
3
|
-
*
|
|
4
|
-
* The backoffice (internal admin tool) authorizes against its own
|
|
5
|
-
* `backoffice_user_permission` table, never against a dealer's `user_dealer`
|
|
6
|
-
* membership. Its permission ids share the `permission` table in the
|
|
7
|
-
* database with the product catalog above, but the two are otherwise
|
|
8
|
-
* unrelated: a `backoffice.*` id is never assignable to a dealer role, and a
|
|
9
|
-
* product id is never assignable to a backoffice user. Keeping them as a
|
|
10
|
-
* separate export (instead of a top-level key inside `PERMISSIONS`) makes
|
|
11
|
-
* that boundary explicit and lets each side filter the other out of its own
|
|
12
|
-
* catalog listing.
|
|
13
|
-
*/
|
|
14
|
-
export const BACKOFFICE_PERMISSIONS = {
|
|
15
|
-
DEALERS: {
|
|
16
|
-
VIEW: "backoffice.dealers.view",
|
|
17
|
-
MANAGE: "backoffice.dealers.manage",
|
|
18
|
-
},
|
|
19
|
-
USERS: {
|
|
20
|
-
VIEW: "backoffice.users.view",
|
|
21
|
-
MANAGE: "backoffice.users.manage",
|
|
22
|
-
},
|
|
23
|
-
/**
|
|
24
|
-
* Split out from USERS.MANAGE on purpose: granting/revoking a backoffice
|
|
25
|
-
* user's permissions is more sensitive than editing their name or email,
|
|
26
|
-
* and folding both into one permission let any admin escalate themselves
|
|
27
|
-
* to anything. No VIEW counterpart — reading a user's permissions is
|
|
28
|
-
* already covered by USERS.VIEW (GET /backoffice/users/:id).
|
|
29
|
-
*/
|
|
30
|
-
PERMISSIONS: {
|
|
31
|
-
MANAGE: "backoffice.permissions.manage",
|
|
32
|
-
},
|
|
33
|
-
PAYMENTS: {
|
|
34
|
-
VIEW: "backoffice.payments.view",
|
|
35
|
-
MANAGE: "backoffice.payments.manage",
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* Management of per-dealer resources from the backoffice — catalogs each
|
|
39
|
-
* dealer otherwise manages under Company → Resources: bank, color, floor,
|
|
40
|
-
* purchase_source, agency, plate_origin, wholesale_target,
|
|
41
|
-
* commission_category, deal_actor_type, title_status,
|
|
42
|
-
* car_extra_category/type, deal_extra_category/type, arbitration_issue_type.
|
|
43
|
-
* One permission per area (same grain as DEALERS/USERS/PAYMENTS), not one
|
|
44
|
-
* per entity — 15 very similar entities, one permission each would be
|
|
45
|
-
* noise with no real granularity benefit.
|
|
46
|
-
*/
|
|
47
|
-
DEALER_RESOURCES: {
|
|
48
|
-
VIEW: "backoffice.dealer_resources.view",
|
|
49
|
-
MANAGE: "backoffice.dealer_resources.manage",
|
|
50
|
-
},
|
|
51
|
-
/** Global vehicle catalog: brand/model/trim/style/fuel-type/title-brand. */
|
|
52
|
-
CATALOG: {
|
|
53
|
-
VIEW: "backoffice.catalog.view",
|
|
54
|
-
MANAGE: "backoffice.catalog.manage",
|
|
55
|
-
},
|
|
56
|
-
/**
|
|
57
|
-
* Management of a dealer's roles and permissions from the backoffice —
|
|
58
|
-
* roles, role↔permission, role↔user and direct user↔permission grants.
|
|
59
|
-
* Its own permission (not DEALER_RESOURCES): roles/permissions govern a
|
|
60
|
-
* dealer's whole RBAC, more sensitive than a catalog of colors/banks.
|
|
61
|
-
*/
|
|
62
|
-
DEALER_ROLES: {
|
|
63
|
-
VIEW: "backoffice.dealer_roles.view",
|
|
64
|
-
MANAGE: "backoffice.dealer_roles.manage",
|
|
65
|
-
},
|
|
66
|
-
/**
|
|
67
|
-
* Members of any dealer from the backoffice: list them, view one, and
|
|
68
|
-
* replace its roles and deal actor types. Its own permission (not
|
|
69
|
-
* DEALER_ROLES): who may edit a dealer's role catalog is not the same as who
|
|
70
|
-
* may re-assign people to those roles. Never touches a member's direct
|
|
71
|
-
* permissions.
|
|
72
|
-
*/
|
|
73
|
-
DEALER_MEMBERS: {
|
|
74
|
-
VIEW: "backoffice.dealer_members.view",
|
|
75
|
-
MANAGE: "backoffice.dealer_members.manage",
|
|
76
|
-
},
|
|
77
|
-
/**
|
|
78
|
-
* Dealer-to-dealer relationships of any dealer from the backoffice: list them
|
|
79
|
-
* and (MANAGE) create/revoke/suspend/reactivate a relationship and set the
|
|
80
|
-
* capabilities one dealer grants another. Management only — the product keeps
|
|
81
|
-
* the runtime read-path that resolves cross-dealer access per request.
|
|
82
|
-
*/
|
|
83
|
-
DEALER_RELATIONSHIPS: {
|
|
84
|
-
VIEW: "backoffice.dealer_relationships.view",
|
|
85
|
-
MANAGE: "backoffice.dealer_relationships.manage",
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* Dealer groups from the backoffice: list them and (MANAGE) create/update/
|
|
89
|
-
* delete a group, add/remove members, set the group permission contract,
|
|
90
|
-
* manage group user assignments and propagate roles across the group.
|
|
91
|
-
*/
|
|
92
|
-
DEALER_GROUPS: {
|
|
93
|
-
VIEW: "backoffice.dealer_groups.view",
|
|
94
|
-
MANAGE: "backoffice.dealer_groups.manage",
|
|
95
|
-
},
|
|
96
|
-
/**
|
|
97
|
-
* Workflows of any dealer from the backoffice: list them, open the editor,
|
|
98
|
-
* and (MANAGE) create, edit, version and test them, including the AI
|
|
99
|
-
* assistant. Never decides which workflows run in production: that is
|
|
100
|
-
* assigned by each dealer from the product.
|
|
101
|
-
*/
|
|
102
|
-
WORKFLOWS: {
|
|
103
|
-
VIEW: "backoffice.workflows.view",
|
|
104
|
-
MANAGE: "backoffice.workflows.manage",
|
|
105
|
-
},
|
|
106
|
-
/**
|
|
107
|
-
* Platform-to-dealer billing (dealernode-backend `src/billing`): plans,
|
|
108
|
-
* global charge provider, dealer subscriptions, cards and invoices. Not
|
|
109
|
-
* PAYMENTS, which is what a dealer charges its own buyers.
|
|
110
|
-
*/
|
|
111
|
-
BILLING: {
|
|
112
|
-
VIEW: "backoffice.billing.view",
|
|
113
|
-
MANAGE: "backoffice.billing.manage",
|
|
114
|
-
/**
|
|
115
|
-
* Load and change the platform's merchant credentials on each charge
|
|
116
|
-
* provider. Separate from MANAGE because these keys move money: whoever
|
|
117
|
-
* manages plans and subscriptions doesn't need to be able to change them.
|
|
118
|
-
*/
|
|
119
|
-
CREDENTIALS: "backoffice.billing.credentials",
|
|
120
|
-
},
|
|
121
|
-
} as const;
|
|
122
|
-
|
|
123
|
-
export type BackofficePermission = typeof BACKOFFICE_PERMISSIONS;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* The actual union of backoffice permission id strings. `BackofficePermission`
|
|
127
|
-
* (the type of the whole tree, mirroring `Permission` above) can't be used to
|
|
128
|
-
* type "any single backoffice permission id" — this can.
|
|
129
|
-
*/
|
|
130
|
-
type Leaves<T> = T extends string ? T : { [K in keyof T]: Leaves<T[K]> }[keyof T];
|
|
131
|
-
export type BackofficePermissionId = Leaves<BackofficePermission>;
|
|
132
|
-
|
|
133
|
-
function flatten(node: Record<string, unknown>): BackofficePermissionId[] {
|
|
134
|
-
const values: BackofficePermissionId[] = [];
|
|
135
|
-
for (const key of Object.keys(node)) {
|
|
136
|
-
const value = node[key];
|
|
137
|
-
if (typeof value === "string") {
|
|
138
|
-
values.push(value as BackofficePermissionId);
|
|
139
|
-
} else if (typeof value === "object" && value !== null) {
|
|
140
|
-
values.push(...flatten(value as Record<string, unknown>));
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return values;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const ALL_BACKOFFICE_PERMISSIONS = flatten(BACKOFFICE_PERMISSIONS);
|
|
147
|
-
const READ_ONLY_BACKOFFICE_PERMISSIONS = ALL_BACKOFFICE_PERMISSIONS.filter((id) =>
|
|
148
|
-
id.endsWith(".view"),
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Selection presets for the permission-assignment UI. Consumers resolve
|
|
153
|
-
* these ids against their own `permission` table rows (the DB, not this
|
|
154
|
-
* package, owns the ULIDs) — see `GET /backoffice/permissions/backoffice`
|
|
155
|
-
* in dealernode-backend.
|
|
156
|
-
*/
|
|
157
|
-
export const BACKOFFICE_PERMISSION_PRESETS = {
|
|
158
|
-
/** Every `*.view` permission, nothing else. */
|
|
159
|
-
READ_ONLY: READ_ONLY_BACKOFFICE_PERMISSIONS,
|
|
160
|
-
/** Read-only plus the two areas support routinely needs to act on. */
|
|
161
|
-
SUPPORT: [
|
|
162
|
-
...READ_ONLY_BACKOFFICE_PERMISSIONS,
|
|
163
|
-
BACKOFFICE_PERMISSIONS.DEALERS.MANAGE,
|
|
164
|
-
BACKOFFICE_PERMISSIONS.DEALER_RESOURCES.MANAGE,
|
|
165
|
-
BACKOFFICE_PERMISSIONS.DEALER_RELATIONSHIPS.MANAGE,
|
|
166
|
-
],
|
|
167
|
-
/** Every backoffice permission. */
|
|
168
|
-
ADMIN: ALL_BACKOFFICE_PERMISSIONS,
|
|
169
|
-
} as const satisfies Record<string, readonly BackofficePermissionId[]>;
|
package/src/index.ts
DELETED
package/src/permissions.ts
DELETED
|
@@ -1,884 +0,0 @@
|
|
|
1
|
-
export const PERMISSIONS = {
|
|
2
|
-
// ============================================
|
|
3
|
-
// GLOBAL
|
|
4
|
-
// ============================================
|
|
5
|
-
GLOBAL: {
|
|
6
|
-
PERMISSIONS: {
|
|
7
|
-
MANAGE: "global.permissions.manage",
|
|
8
|
-
},
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
// ============================================
|
|
12
|
-
// USER
|
|
13
|
-
// ============================================
|
|
14
|
-
USER: {
|
|
15
|
-
OPERATIONS: {
|
|
16
|
-
VIEW: "user.operations.view",
|
|
17
|
-
CREATE: "user.operations.create",
|
|
18
|
-
},
|
|
19
|
-
FILES: {
|
|
20
|
-
UPLOAD: "user.files.upload",
|
|
21
|
-
DOWNLOAD: "user.files.download",
|
|
22
|
-
DELETE: "user.files.delete",
|
|
23
|
-
},
|
|
24
|
-
DEALER: {
|
|
25
|
-
OPERATIONS: {
|
|
26
|
-
VIEW: "user.dealer.operations.view",
|
|
27
|
-
ASSIGN: "user.dealer.operations.assign",
|
|
28
|
-
UPDATE: "user.dealer.operations.update",
|
|
29
|
-
UNASSIGN: "user.dealer.operations.unassign",
|
|
30
|
-
ACTIVATE: "user.dealer.operations.activate",
|
|
31
|
-
DEACTIVATE: "user.dealer.operations.deactivate",
|
|
32
|
-
},
|
|
33
|
-
ACTOR_TYPE: {
|
|
34
|
-
VIEW: "user.dealer.actor_type.view",
|
|
35
|
-
ASSIGN: "user.dealer.actor_type.assign",
|
|
36
|
-
DELETE: "user.dealer.actor_type.delete",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
// ============================================
|
|
42
|
-
// COMMISSION
|
|
43
|
-
// ============================================
|
|
44
|
-
COMMISSION: {
|
|
45
|
-
OPERATIONS: {
|
|
46
|
-
VIEW: "commission.operations.view",
|
|
47
|
-
CREATE: "commission.operations.create",
|
|
48
|
-
UPDATE: "commission.operations.update",
|
|
49
|
-
DELETE: "commission.operations.delete",
|
|
50
|
-
APPROVE: "commission.operations.approve",
|
|
51
|
-
REVERT_APPROVE: "commission.operations.revert_approve",
|
|
52
|
-
PAY: "commission.operations.pay",
|
|
53
|
-
REVERT_PAY: "commission.operations.revert-pay",
|
|
54
|
-
},
|
|
55
|
-
DEAL_COMMISSION: {
|
|
56
|
-
OPERATIONS: {
|
|
57
|
-
VIEW: "commission.deal_commission.operations.view",
|
|
58
|
-
CREATE: "commission.deal_commission.operations.create",
|
|
59
|
-
UPDATE: "commission.deal_commission.operations.update",
|
|
60
|
-
DELETE: "commission.deal_commission.operations.delete",
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
CAR_COMMISSION: {
|
|
64
|
-
OPERATIONS: {
|
|
65
|
-
VIEW: "commission.car_commission.operations.view",
|
|
66
|
-
CREATE: "commission.car_commission.operations.create",
|
|
67
|
-
UPDATE: "commission.car_commission.operations.update",
|
|
68
|
-
DELETE: "commission.car_commission.operations.delete",
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
EXTRA_COMMISSION: {
|
|
72
|
-
OPERATIONS: {
|
|
73
|
-
VIEW: "commission.extra_commission.operations.view",
|
|
74
|
-
CREATE: "commission.extra_commission.operations.create",
|
|
75
|
-
UPDATE: "commission.extra_commission.operations.update",
|
|
76
|
-
DELETE: "commission.extra_commission.operations.delete",
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
SALARY: {
|
|
80
|
-
OPERATIONS: {
|
|
81
|
-
VIEW: "commission.salary.operations.view",
|
|
82
|
-
CREATE: "commission.salary.operations.create",
|
|
83
|
-
UPDATE: "commission.salary.operations.update",
|
|
84
|
-
DELETE: "commission.salary.operations.delete",
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
SALARYS_CHEDULE: {
|
|
88
|
-
OPERATIONS: {
|
|
89
|
-
VIEW: "commission.salary_schedule.operations.view",
|
|
90
|
-
CREATE: "commission.salary_schedule.operations.create",
|
|
91
|
-
UPDATE: "commission.salary_schedule.operations.update",
|
|
92
|
-
DELETE: "commission.salary_schedule.operations.delete",
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
USER_DEALER_SALARY: {
|
|
96
|
-
OPERATIONS: {
|
|
97
|
-
VIEW: "commission.user_dealer_salary.operations.view",
|
|
98
|
-
CREATE: "commission.user_dealer_salary.operations.create",
|
|
99
|
-
UPDATE: "commission.user_dealer_salary.operations.update",
|
|
100
|
-
DELETE: "commission.user_dealer_salary.operations.delete",
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
CATEGORY: {
|
|
104
|
-
VIEW: "commission.category.view",
|
|
105
|
-
MANAGE: "commission.category.manage",
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
// ============================================
|
|
110
|
-
// DEALER
|
|
111
|
-
// ============================================
|
|
112
|
-
DEALER: {
|
|
113
|
-
OPERATIONS: {
|
|
114
|
-
VIEW: "dealer.operations.view",
|
|
115
|
-
CREATE: "dealer.operations.create",
|
|
116
|
-
UPDATE: "dealer.operations.update",
|
|
117
|
-
DELETE: "dealer.operations.delete",
|
|
118
|
-
},
|
|
119
|
-
FILES: {
|
|
120
|
-
UPLOAD: "dealer.files.upload",
|
|
121
|
-
DOWNLOAD: "dealer.files.download",
|
|
122
|
-
DELETE: "dealer.files.delete",
|
|
123
|
-
},
|
|
124
|
-
ONBOARDING: {
|
|
125
|
-
SUBMIT: "dealer.onboarding.submit",
|
|
126
|
-
APPROVE: "dealer.onboarding.approve",
|
|
127
|
-
REJECT: "dealer.onboarding.reject",
|
|
128
|
-
ACTIVATE: "dealer.onboarding.activate",
|
|
129
|
-
REVERT: "dealer.onboarding.revert",
|
|
130
|
-
},
|
|
131
|
-
LICENSE: {
|
|
132
|
-
VIEW: "dealer.license.view",
|
|
133
|
-
CREATE: "dealer.license.create",
|
|
134
|
-
UPDATE: "dealer.license.update",
|
|
135
|
-
DELETE: "dealer.license.delete",
|
|
136
|
-
},
|
|
137
|
-
INTEGRATIONS: {
|
|
138
|
-
VIEW: "dealer.integrations.view",
|
|
139
|
-
MANAGE: "dealer.integrations.manage",
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
// ============================================
|
|
144
|
-
// CLIENT
|
|
145
|
-
// ============================================
|
|
146
|
-
CLIENT: {
|
|
147
|
-
OPERATIONS: {
|
|
148
|
-
VIEW: "client.operations.view",
|
|
149
|
-
MANAGE: "client.operations.manage",
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
// ============================================
|
|
154
|
-
// BANK
|
|
155
|
-
// ============================================
|
|
156
|
-
BANK: {
|
|
157
|
-
OPERATIONS: {
|
|
158
|
-
VIEW: "bank.operations.view",
|
|
159
|
-
MANAGE: "bank.operations.manage",
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
// ============================================
|
|
164
|
-
// AGENCY
|
|
165
|
-
// ============================================
|
|
166
|
-
AGENCY: {
|
|
167
|
-
OPERATIONS: {
|
|
168
|
-
VIEW: "agency.operations.view",
|
|
169
|
-
MANAGE: "agency.operations.manage",
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
// ============================================
|
|
174
|
-
// PLATE ORIGIN
|
|
175
|
-
// ============================================
|
|
176
|
-
PLATE_ORIGIN: {
|
|
177
|
-
OPERATIONS: {
|
|
178
|
-
VIEW: "plate-origin.operations.view",
|
|
179
|
-
MANAGE: "plate-origin.operations.manage",
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
// ============================================
|
|
184
|
-
// ARBITRATION
|
|
185
|
-
// ============================================
|
|
186
|
-
ARBITRATION: {
|
|
187
|
-
OPERATIONS: {
|
|
188
|
-
VIEW: "arbitration.operations.view",
|
|
189
|
-
MANAGE: "arbitration.operations.manage",
|
|
190
|
-
DELETE: "arbitration.operations.delete",
|
|
191
|
-
},
|
|
192
|
-
FILES: {
|
|
193
|
-
UPLOAD: "arbitration.files.upload",
|
|
194
|
-
DOWNLOAD: "arbitration.files.download",
|
|
195
|
-
DELETE: "arbitration.files.delete",
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
// ============================================
|
|
200
|
-
// ARBITRATION ISSUE TYPE
|
|
201
|
-
// ============================================
|
|
202
|
-
ARBITRATION_ISSUE_TYPE: {
|
|
203
|
-
OPERATIONS: {
|
|
204
|
-
VIEW: "arbitration-issue-type.operations.view",
|
|
205
|
-
MANAGE: "arbitration-issue-type.operations.manage",
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
// ============================================
|
|
210
|
-
// DEAL
|
|
211
|
-
// ============================================
|
|
212
|
-
DEAL: {
|
|
213
|
-
VIEW: {
|
|
214
|
-
TRADE: "deal.view.trade",
|
|
215
|
-
EXTRAS: "deal.view.extras",
|
|
216
|
-
GPS: "deal.view.gps",
|
|
217
|
-
},
|
|
218
|
-
OPERATIONS: {
|
|
219
|
-
VIEW: "deal.operations.view",
|
|
220
|
-
VIEW_MY_DEALS: "deal.operations.view_my_deals",
|
|
221
|
-
},
|
|
222
|
-
FILES: {
|
|
223
|
-
UPLOAD: "deal.files.upload",
|
|
224
|
-
DOWNLOAD: "deal.files.download",
|
|
225
|
-
DELETE: "deal.files.delete",
|
|
226
|
-
},
|
|
227
|
-
PLATE: {
|
|
228
|
-
OPERATIONS: {
|
|
229
|
-
VIEW: "deal.plate.operations.view",
|
|
230
|
-
VIEW_MY_PLATES: "deal.plate.operations.view_my_plates",
|
|
231
|
-
CREATE: "deal.plate.operations.create",
|
|
232
|
-
UPDATE: "deal.plate.operations.update",
|
|
233
|
-
DELETE: "deal.plate.operations.delete",
|
|
234
|
-
PAY: "deal.plate.operations.pay",
|
|
235
|
-
CANCEL: "deal.plate.operations.cancel",
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
PICKUP_PAYMENT: {
|
|
239
|
-
OPERATIONS: {
|
|
240
|
-
VIEW: "deal.pickup_payment.operations.view",
|
|
241
|
-
PAY: "deal.pickup_payment.operations.pay",
|
|
242
|
-
CANCEL: "deal.pickup_payment.operations.cancel",
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
FINANCED: {
|
|
246
|
-
OPERATIONS: {
|
|
247
|
-
VIEW: "deal.financed.operations.view",
|
|
248
|
-
VIEW_MY_DEALS: "deal.financed.operations.view_my_deals",
|
|
249
|
-
CREATE: "deal.financed.operations.create",
|
|
250
|
-
UPDATE: "deal.financed.operations.update",
|
|
251
|
-
UPDATE_LIMITED: "deal.financed.operations.update_limited",
|
|
252
|
-
ACCEPT: "deal.financed.operations.accept",
|
|
253
|
-
FUND: "deal.financed.operations.fund",
|
|
254
|
-
BOOK: "deal.financed.operations.book",
|
|
255
|
-
TO_FAILED_DEAL: "deal.financed.operations.to_failed_deal",
|
|
256
|
-
MANAGE: "deal.financed.operations.manage",
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
SPOT: {
|
|
260
|
-
OPERATIONS: {
|
|
261
|
-
VIEW: "deal.spot.operations.view",
|
|
262
|
-
VIEW_MY_DEALS: "deal.spot.operations.view_my_deals",
|
|
263
|
-
CREATE: "deal.spot.operations.create",
|
|
264
|
-
UPDATE: "deal.spot.operations.update",
|
|
265
|
-
UPDATE_LIMITED: "deal.spot.operations.update_limited",
|
|
266
|
-
ACCEPT: "deal.spot.operations.accept",
|
|
267
|
-
TRANSFORM: "deal.spot.operations.transform",
|
|
268
|
-
TO_FAILED_DEAL: "deal.spot.operations.to_failed_deal",
|
|
269
|
-
MANAGE: "deal.spot.operations.manage",
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
CASH: {
|
|
273
|
-
OPERATIONS: {
|
|
274
|
-
VIEW: "deal.cash.operations.view",
|
|
275
|
-
VIEW_MY_DEALS: "deal.cash.operations.view_my_deals",
|
|
276
|
-
CREATE: "deal.cash.operations.create",
|
|
277
|
-
UPDATE: "deal.cash.operations.update",
|
|
278
|
-
UPDATE_LIMITED: "deal.cash.operations.update_limited",
|
|
279
|
-
ACCEPT: "deal.cash.operations.accept",
|
|
280
|
-
TO_FAILED_DEAL: "deal.cash.operations.to_failed_deal",
|
|
281
|
-
MANAGE: "deal.cash.operations.manage",
|
|
282
|
-
},
|
|
283
|
-
},
|
|
284
|
-
BHPH: {
|
|
285
|
-
OPERATIONS: {
|
|
286
|
-
VIEW: "deal.bhph.operations.view",
|
|
287
|
-
VIEW_MY_DEALS: "deal.bhph.operations.view_my_deals",
|
|
288
|
-
CREATE: "deal.bhph.operations.create",
|
|
289
|
-
UPDATE: "deal.bhph.operations.update",
|
|
290
|
-
UPDATE_LIMITED: "deal.bhph.operations.update_limited",
|
|
291
|
-
ACCEPT: "deal.bhph.operations.accept",
|
|
292
|
-
TO_FAILED_DEAL: "deal.bhph.operations.to_failed_deal",
|
|
293
|
-
MANAGE: "deal.bhph.operations.manage",
|
|
294
|
-
},
|
|
295
|
-
PAYMENTS: {
|
|
296
|
-
VIEW: "deal.bhph.payments.view",
|
|
297
|
-
PAY: "deal.bhph.payments.pay",
|
|
298
|
-
CANCEL: "deal.bhph.payments.cancel",
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
GPS: {
|
|
302
|
-
OPERATIONS: {
|
|
303
|
-
VIEW: "deal.gps.operations.view",
|
|
304
|
-
CREATE: "deal.gps.operations.create",
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
TRADE: {
|
|
308
|
-
OPERATIONS: {
|
|
309
|
-
VIEW: "deal.trade.operations.view",
|
|
310
|
-
CREATE: "deal.trade.operations.create",
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
RESOURCES: {
|
|
314
|
-
EXTRA: {
|
|
315
|
-
VIEW: "deal.resources.extra.view",
|
|
316
|
-
MANAGE: "deal.resources.extra.manage",
|
|
317
|
-
},
|
|
318
|
-
ACTOR_TYPE: {
|
|
319
|
-
VIEW: "deal.resources.actor_type.view",
|
|
320
|
-
MANAGE: "deal.resources.actor_type.manage",
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
PAYMENT: {
|
|
324
|
-
OPERATIONS: {
|
|
325
|
-
VIEW: "deal.payment.operations.view",
|
|
326
|
-
MANAGE: "deal.payment.operations.manage",
|
|
327
|
-
},
|
|
328
|
-
},
|
|
329
|
-
COMMENT: {
|
|
330
|
-
VIEW: "deal.comment.view",
|
|
331
|
-
CREATE: "deal.comment.create",
|
|
332
|
-
UPDATE: "deal.comment.update",
|
|
333
|
-
DELETE: "deal.comment.delete",
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
|
|
337
|
-
// ============================================
|
|
338
|
-
// FAIL DEAL
|
|
339
|
-
// ============================================
|
|
340
|
-
FAIL_DEAL: {
|
|
341
|
-
UNWIND: {
|
|
342
|
-
OPERATIONS: {
|
|
343
|
-
VIEW: "fail_deal.unwind.operations.view",
|
|
344
|
-
VIEW_MY_DEALS: "fail_deal.unwind.operations.view_my_deals",
|
|
345
|
-
MANAGE: "fail_deal.unwind.operations.manage",
|
|
346
|
-
},
|
|
347
|
-
FILES: {
|
|
348
|
-
UPLOAD: "fail_deal.unwind.files.upload",
|
|
349
|
-
DOWNLOAD: "fail_deal.unwind.files.download",
|
|
350
|
-
DELETE: "fail_deal.unwind.files.delete",
|
|
351
|
-
},
|
|
352
|
-
RESOURCES: {
|
|
353
|
-
EXTRA: {
|
|
354
|
-
VIEW: "fail_deal.unwind.resources.extra.view",
|
|
355
|
-
MANAGE: "fail_deal.unwind.resources.extra.manage",
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
},
|
|
359
|
-
DEAD_DEAL: {
|
|
360
|
-
RESOURCES: {
|
|
361
|
-
EXTRA: {
|
|
362
|
-
VIEW: "fail_deal.dead_deal.resources.extra.view",
|
|
363
|
-
MANAGE: "fail_deal.dead_deal.resources.extra.manage",
|
|
364
|
-
},
|
|
365
|
-
},
|
|
366
|
-
OPERATIONS: {
|
|
367
|
-
VIEW: "fail_deal.dead_deal.operations.view",
|
|
368
|
-
VIEW_MY_DEALS: "fail_deal.dead_deal.operations.view_my_deals",
|
|
369
|
-
MANAGE: "fail_deal.dead_deal.operations.manage",
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
BUY_BACK: {
|
|
373
|
-
OPERATIONS: {
|
|
374
|
-
VIEW_MY_DEALS: "fail_deal.buy_back.operations.view_my_deals",
|
|
375
|
-
VIEW: "fail_deal.buy_back.operations.view",
|
|
376
|
-
MANAGE: "fail_deal.buy_back.operations.manage",
|
|
377
|
-
},
|
|
378
|
-
RESOURCES: {
|
|
379
|
-
EXTRA: {
|
|
380
|
-
VIEW: "fail_deal.buy_back.resources.extra.view",
|
|
381
|
-
MANAGE: "fail_deal.buy_back.resources.extra.manage",
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
|
|
387
|
-
// ============================================
|
|
388
|
-
// PAYMENT
|
|
389
|
-
// ============================================
|
|
390
|
-
PAYMENT: {
|
|
391
|
-
OPERATIONS: {
|
|
392
|
-
VIEW: "payment.operations.view",
|
|
393
|
-
MANAGE: "payment.operations.manage",
|
|
394
|
-
},
|
|
395
|
-
CONNECTED_ACCOUNT: {
|
|
396
|
-
VIEW: "payment.connected-account.view",
|
|
397
|
-
CREATE: "payment.connected-account.create",
|
|
398
|
-
SYNC: "payment.connected-account.sync",
|
|
399
|
-
},
|
|
400
|
-
CUSTOMER: {
|
|
401
|
-
VIEW: "payment.customer.view",
|
|
402
|
-
CREATE: "payment.customer.create",
|
|
403
|
-
},
|
|
404
|
-
PAYMENT_INTENT: {
|
|
405
|
-
VIEW: "payment.payment-intent.view",
|
|
406
|
-
CREATE: "payment.payment-intent.create",
|
|
407
|
-
CONFIRM: "payment.payment-intent.confirm",
|
|
408
|
-
CANCEL: "payment.payment-intent.cancel",
|
|
409
|
-
SYNC: "payment.payment-intent.sync",
|
|
410
|
-
},
|
|
411
|
-
PAYMENT_METHOD: {
|
|
412
|
-
VIEW: "payment.payment-method.view",
|
|
413
|
-
ATTACH: "payment.payment-method.attach",
|
|
414
|
-
DELETE: "payment.payment-method.delete",
|
|
415
|
-
},
|
|
416
|
-
PAYMENT_LINK: {
|
|
417
|
-
VIEW: "payment.payment-link.view",
|
|
418
|
-
CREATE: "payment.payment-link.create",
|
|
419
|
-
},
|
|
420
|
-
SCHEDULE: {
|
|
421
|
-
VIEW: "payment.schedule.view",
|
|
422
|
-
CREATE: "payment.schedule.create",
|
|
423
|
-
DELETE: "payment.schedule.delete",
|
|
424
|
-
},
|
|
425
|
-
SUBSCRIPTION: {
|
|
426
|
-
VIEW: "payment.subscription.view",
|
|
427
|
-
CREATE: "payment.subscription.create",
|
|
428
|
-
DELETE: "payment.subscription.delete",
|
|
429
|
-
},
|
|
430
|
-
DISPUTE: {
|
|
431
|
-
VIEW: "payment.dispute.view",
|
|
432
|
-
MANAGE: "payment.dispute.manage",
|
|
433
|
-
},
|
|
434
|
-
REFUND: {
|
|
435
|
-
VIEW: "payment.refund.view",
|
|
436
|
-
MANAGE: "payment.refund.manage",
|
|
437
|
-
},
|
|
438
|
-
MANUAL: {
|
|
439
|
-
CHECK: {
|
|
440
|
-
VIEW: "payment.manual.check.view",
|
|
441
|
-
PROCESS: "payment.manual.check.process",
|
|
442
|
-
},
|
|
443
|
-
CASH: {
|
|
444
|
-
VIEW: "payment.manual.cash.view",
|
|
445
|
-
PROCESS: "payment.manual.cash.process",
|
|
446
|
-
},
|
|
447
|
-
DIGITAL: {
|
|
448
|
-
VIEW: "payment.manual.digital.view",
|
|
449
|
-
PROCESS: "payment.manual.digital.process",
|
|
450
|
-
},
|
|
451
|
-
},
|
|
452
|
-
SPLIT: {
|
|
453
|
-
VIEW: "payment.split.view",
|
|
454
|
-
MANAGE: "payment.split.manage",
|
|
455
|
-
},
|
|
456
|
-
TERMINAL: {
|
|
457
|
-
LOCATION: {
|
|
458
|
-
VIEW: "payment.terminal.location.view",
|
|
459
|
-
CREATE: "payment.terminal.location.create",
|
|
460
|
-
},
|
|
461
|
-
READER: {
|
|
462
|
-
VIEW: "payment.terminal.reader.view",
|
|
463
|
-
CREATE: "payment.terminal.reader.create",
|
|
464
|
-
DELETE: "payment.terminal.reader.delete",
|
|
465
|
-
},
|
|
466
|
-
PAYMENT: {
|
|
467
|
-
VIEW: "payment.terminal.payment.view",
|
|
468
|
-
PROCESS: "payment.terminal.payment.process",
|
|
469
|
-
},
|
|
470
|
-
PIN: {
|
|
471
|
-
MANAGE_ALL: "payment.terminal.pin.manage_all",
|
|
472
|
-
},
|
|
473
|
-
DEVICE: {
|
|
474
|
-
PROVISION: "payment.terminal.device.provision",
|
|
475
|
-
},
|
|
476
|
-
},
|
|
477
|
-
BILLING: {
|
|
478
|
-
MANAGE: "payment.billing.manage",
|
|
479
|
-
},
|
|
480
|
-
FILES: {
|
|
481
|
-
UPLOAD: "payment.files.upload",
|
|
482
|
-
DOWNLOAD: "payment.files.download",
|
|
483
|
-
DELETE: "payment.files.delete",
|
|
484
|
-
},
|
|
485
|
-
},
|
|
486
|
-
|
|
487
|
-
// ============================================
|
|
488
|
-
// CAR
|
|
489
|
-
// ============================================
|
|
490
|
-
CAR: {
|
|
491
|
-
OPERATIONS: {
|
|
492
|
-
VIEW: "car.operations.view",
|
|
493
|
-
},
|
|
494
|
-
INVENTORY: {
|
|
495
|
-
VIEW: {
|
|
496
|
-
EXTRA: "car.inventory.view.extra",
|
|
497
|
-
},
|
|
498
|
-
OPERATIONS: {
|
|
499
|
-
VIEW: "car.inventory.operations.view",
|
|
500
|
-
VIEW_OPERATIONS: "car.inventory.operations.view_operations",
|
|
501
|
-
CREATE: "car.inventory.operations.create",
|
|
502
|
-
UPDATE: "car.inventory.operations.update",
|
|
503
|
-
DELETE: "car.inventory.operations.delete",
|
|
504
|
-
RESTORE: "car.inventory.operations.restore",
|
|
505
|
-
VALIDATE_VIN: "car.inventory.operations.validate_vin",
|
|
506
|
-
},
|
|
507
|
-
FILES: {
|
|
508
|
-
UPLOAD: "car.inventory.files.upload",
|
|
509
|
-
DOWNLOAD: "car.inventory.files.download",
|
|
510
|
-
DELETE: "car.inventory.files.delete",
|
|
511
|
-
},
|
|
512
|
-
},
|
|
513
|
-
EXTRA: {
|
|
514
|
-
OPERATIONS: {
|
|
515
|
-
CREATE: "car.extra.operations.create",
|
|
516
|
-
},
|
|
517
|
-
},
|
|
518
|
-
GPS: {
|
|
519
|
-
OPERATIONS: {
|
|
520
|
-
VIEW: "car.gps.operations.view",
|
|
521
|
-
CREATE: "car.gps.operations.create",
|
|
522
|
-
},
|
|
523
|
-
},
|
|
524
|
-
WORKSHOP: {
|
|
525
|
-
OPERATIONS: {
|
|
526
|
-
CREATE: "car.workshop.operations.create",
|
|
527
|
-
UPDATE: "car.workshop.operations.update",
|
|
528
|
-
DELETE: "car.workshop.operations.delete",
|
|
529
|
-
},
|
|
530
|
-
COSTS: {
|
|
531
|
-
CREATE: "car.workshop.costs.create",
|
|
532
|
-
UPDATE: "car.workshop.costs.update",
|
|
533
|
-
DELETE: "car.workshop.costs.delete",
|
|
534
|
-
},
|
|
535
|
-
COST_TEMPLATES: {
|
|
536
|
-
CREATE: "car.workshop.cost_templates.create",
|
|
537
|
-
UPDATE: "car.workshop.cost_templates.update",
|
|
538
|
-
DELETE: "car.workshop.cost_templates.delete",
|
|
539
|
-
},
|
|
540
|
-
},
|
|
541
|
-
TRADE: {
|
|
542
|
-
OPERATIONS: {
|
|
543
|
-
VIEW: "car.trade.operations.view",
|
|
544
|
-
CREATE: "car.trade.operations.create",
|
|
545
|
-
DELETE: "car.trade.operations.delete",
|
|
546
|
-
TRANSFORM: "car.trade.operations.transform",
|
|
547
|
-
},
|
|
548
|
-
},
|
|
549
|
-
DRAFT: {
|
|
550
|
-
OPERATIONS: {
|
|
551
|
-
VIEW: "car.draft.operations.view",
|
|
552
|
-
CREATE: "car.draft.operations.create",
|
|
553
|
-
UPDATE: "car.draft.operations.update",
|
|
554
|
-
DELETE: "car.draft.operations.delete",
|
|
555
|
-
PUBLISH: "car.draft.operations.publish",
|
|
556
|
-
},
|
|
557
|
-
},
|
|
558
|
-
TRANSIT: {
|
|
559
|
-
VIEW: {
|
|
560
|
-
EXTRA: "car.transit.view.extra",
|
|
561
|
-
},
|
|
562
|
-
OPERATIONS: {
|
|
563
|
-
CREATE: "car.transit.operations.create",
|
|
564
|
-
UPDATE: "car.transit.operations.update",
|
|
565
|
-
DELETE: "car.transit.operations.delete",
|
|
566
|
-
ARRIVE: "car.transit.operations.arrive",
|
|
567
|
-
VIEW: "car.transit.operations.view",
|
|
568
|
-
},
|
|
569
|
-
COSTS: {
|
|
570
|
-
CREATE: "car.transit.costs.create",
|
|
571
|
-
UPDATE: "car.transit.costs.update",
|
|
572
|
-
DELETE: "car.transit.costs.delete",
|
|
573
|
-
},
|
|
574
|
-
COST_TEMPLATES: {
|
|
575
|
-
CREATE: "car.transit.cost_templates.create",
|
|
576
|
-
UPDATE: "car.transit.cost_templates.update",
|
|
577
|
-
DELETE: "car.transit.cost_templates.delete",
|
|
578
|
-
},
|
|
579
|
-
},
|
|
580
|
-
RESOURCES: {
|
|
581
|
-
BRAND: {
|
|
582
|
-
VIEW: "car.resources.brand.view",
|
|
583
|
-
MANAGE: "car.resources.brand.manage",
|
|
584
|
-
},
|
|
585
|
-
MODEL: {
|
|
586
|
-
VIEW: "car.resources.model.view",
|
|
587
|
-
MANAGE: "car.resources.model.manage",
|
|
588
|
-
},
|
|
589
|
-
TRIM: {
|
|
590
|
-
VIEW: "car.resources.trim.view",
|
|
591
|
-
MANAGE: "car.resources.trim.manage",
|
|
592
|
-
},
|
|
593
|
-
STYLE: {
|
|
594
|
-
VIEW: "car.resources.style.view",
|
|
595
|
-
MANAGE: "car.resources.style.manage",
|
|
596
|
-
},
|
|
597
|
-
TITLE: {
|
|
598
|
-
VIEW: "car.resources.title.view",
|
|
599
|
-
MANAGE: "car.resources.title.manage",
|
|
600
|
-
},
|
|
601
|
-
FUEL_TYPE: {
|
|
602
|
-
VIEW: "car.resources.fuel_type.view",
|
|
603
|
-
MANAGE: "car.resources.fuel_type.manage",
|
|
604
|
-
},
|
|
605
|
-
COLOR: {
|
|
606
|
-
VIEW: "car.resources.color.view",
|
|
607
|
-
MANAGE: "car.resources.color.manage",
|
|
608
|
-
},
|
|
609
|
-
FLOOR: {
|
|
610
|
-
VIEW: "car.resources.floor.view",
|
|
611
|
-
MANAGE: "car.resources.floor.manage",
|
|
612
|
-
},
|
|
613
|
-
PURCHASE_SOURCE: {
|
|
614
|
-
VIEW: "car.resources.purchase_source.view",
|
|
615
|
-
MANAGE: "car.resources.purchase_source.manage",
|
|
616
|
-
},
|
|
617
|
-
EXTRA: {
|
|
618
|
-
VIEW: "car.resources.extra.view",
|
|
619
|
-
MANAGE: "car.resources.extra.manage",
|
|
620
|
-
},
|
|
621
|
-
},
|
|
622
|
-
COMMENT: {
|
|
623
|
-
VIEW: "car.comment.view",
|
|
624
|
-
CREATE: "car.comment.create",
|
|
625
|
-
UPDATE: "car.comment.update",
|
|
626
|
-
DELETE: "car.comment.delete",
|
|
627
|
-
},
|
|
628
|
-
REPOSSESSION: {
|
|
629
|
-
OPERATIONS: {
|
|
630
|
-
VIEW: "car.repossession.operations.view",
|
|
631
|
-
},
|
|
632
|
-
},
|
|
633
|
-
},
|
|
634
|
-
|
|
635
|
-
// ============================================
|
|
636
|
-
// INVITATION
|
|
637
|
-
// ============================================
|
|
638
|
-
INVITATION: {
|
|
639
|
-
OPERATIONS: {
|
|
640
|
-
VIEW: "invitation.operations.view",
|
|
641
|
-
CREATE: "invitation.operations.create",
|
|
642
|
-
REVOKE: "invitation.operations.revoke",
|
|
643
|
-
},
|
|
644
|
-
},
|
|
645
|
-
|
|
646
|
-
// ============================================
|
|
647
|
-
// WORKFLOW
|
|
648
|
-
// ============================================
|
|
649
|
-
WORKFLOW: {
|
|
650
|
-
OPERATIONS: {
|
|
651
|
-
VIEW: "workflow.operations.view",
|
|
652
|
-
MANAGE: "workflow.operations.manage",
|
|
653
|
-
},
|
|
654
|
-
},
|
|
655
|
-
|
|
656
|
-
// ============================================
|
|
657
|
-
// WHOLESALE
|
|
658
|
-
// ============================================
|
|
659
|
-
WHOLESALE: {
|
|
660
|
-
OPERATIONS: {
|
|
661
|
-
VIEW: "wholesale.operations.view",
|
|
662
|
-
MANAGE: "wholesale.operations.manage",
|
|
663
|
-
PAYMENT: "wholesale.operations.payment",
|
|
664
|
-
},
|
|
665
|
-
FILES: {
|
|
666
|
-
UPLOAD: "wholesale.files.upload",
|
|
667
|
-
DOWNLOAD: "wholesale.files.download",
|
|
668
|
-
DELETE: "wholesale.files.delete",
|
|
669
|
-
},
|
|
670
|
-
TARGET: {
|
|
671
|
-
VIEW: "wholesale.target.view",
|
|
672
|
-
MANAGE: "wholesale.target.manage",
|
|
673
|
-
},
|
|
674
|
-
INVITATION: {
|
|
675
|
-
MANAGE: "wholesale.invitation.manage",
|
|
676
|
-
},
|
|
677
|
-
MANUAL: {
|
|
678
|
-
OPERATIONS: {
|
|
679
|
-
VIEW: "manual_wholesale.operations.view",
|
|
680
|
-
MANAGE: "manual_wholesale.operations.manage",
|
|
681
|
-
},
|
|
682
|
-
},
|
|
683
|
-
AUTOMATIC: {
|
|
684
|
-
OPERATIONS: {
|
|
685
|
-
VIEW: "automatic_wholesale.operations.view",
|
|
686
|
-
MANAGE: "automatic_wholesale.operations.manage",
|
|
687
|
-
},
|
|
688
|
-
},
|
|
689
|
-
},
|
|
690
|
-
|
|
691
|
-
// ============================================
|
|
692
|
-
// TRANSFER_CAR
|
|
693
|
-
// ============================================
|
|
694
|
-
TRANSFER_CAR: {
|
|
695
|
-
OPERATIONS: {
|
|
696
|
-
VIEW: "transfer_car.operations.view",
|
|
697
|
-
MANAGE: "transfer_car.operations.manage",
|
|
698
|
-
},
|
|
699
|
-
INVITATION: {
|
|
700
|
-
MANAGE: "transfer_car.invitation.manage",
|
|
701
|
-
},
|
|
702
|
-
},
|
|
703
|
-
|
|
704
|
-
// ============================================
|
|
705
|
-
// DEALER RELATIONSHIP
|
|
706
|
-
// ============================================
|
|
707
|
-
DEALER_RELATIONSHIP: {
|
|
708
|
-
OPERATIONS: {
|
|
709
|
-
VIEW: "dealer_relationship.operations.view",
|
|
710
|
-
},
|
|
711
|
-
RESOURCE: {
|
|
712
|
-
VIEW_INVENTORY: "dealer_relationship.resource.view_inventory",
|
|
713
|
-
TRANSFER_CAR: "dealer_relationship.resource.transfer_car",
|
|
714
|
-
AUTO_APPROVE_TRANSFER_CAR:
|
|
715
|
-
"dealer_relationship.resource.auto_approve_transfer_car",
|
|
716
|
-
CREATE_WHOLESALE_DEAL:
|
|
717
|
-
"dealer_relationship.resource.create_wholesale_deal",
|
|
718
|
-
APPROVE_WHOLESALE_DEAL:
|
|
719
|
-
"dealer_relationship.resource.approve_wholesale_deal",
|
|
720
|
-
VIEW_SHARED_DEALS: "dealer_relationship.resource.view_shared_deals",
|
|
721
|
-
VIEW_SHARED_FAILED_DEALS:
|
|
722
|
-
"dealer_relationship.resource.view_shared_failed_deals",
|
|
723
|
-
USE_BANKS: "dealer_relationship.resource.use_banks",
|
|
724
|
-
UNIQUE_VIN: "dealer_relationship.resource.unique_vin",
|
|
725
|
-
VIEW_GPS: "dealer_relationship.resource.view_gps",
|
|
726
|
-
CREATE_GPS: "dealer_relationship.resource.create_gps",
|
|
727
|
-
VIEW_PLATES: "dealer_relationship.resource.view_plates",
|
|
728
|
-
VIEW_ARBITRATIONS: "dealer_relationship.resource.view_arbitrations",
|
|
729
|
-
},
|
|
730
|
-
},
|
|
731
|
-
|
|
732
|
-
// ============================================
|
|
733
|
-
// DEALER GROUP
|
|
734
|
-
// ============================================
|
|
735
|
-
DEALER_GROUP: {
|
|
736
|
-
OPERATIONS: {
|
|
737
|
-
VIEW: "dealer_group.operations.view",
|
|
738
|
-
CREATE: "dealer_group.operations.create",
|
|
739
|
-
UPDATE: "dealer_group.operations.update",
|
|
740
|
-
DELETE: "dealer_group.operations.delete",
|
|
741
|
-
},
|
|
742
|
-
MEMBERS: {
|
|
743
|
-
INVITE: "dealer_group.members.invite",
|
|
744
|
-
REQUEST_JOIN: "dealer_group.members.request_join",
|
|
745
|
-
ACCEPT: "dealer_group.members.accept",
|
|
746
|
-
REJECT: "dealer_group.members.reject",
|
|
747
|
-
REMOVE: "dealer_group.members.remove",
|
|
748
|
-
},
|
|
749
|
-
USERS: {
|
|
750
|
-
VIEW: "dealer_group.users.view",
|
|
751
|
-
MANAGE: "dealer_group.users.manage",
|
|
752
|
-
},
|
|
753
|
-
},
|
|
754
|
-
|
|
755
|
-
// ============================================
|
|
756
|
-
// ANALYTICS
|
|
757
|
-
// ============================================
|
|
758
|
-
ANALYTICS: {
|
|
759
|
-
OPERATIONS: {
|
|
760
|
-
VIEW: "analytics.operations.view",
|
|
761
|
-
MANAGE: "analytics.operations.manage",
|
|
762
|
-
},
|
|
763
|
-
ASSISTANT: {
|
|
764
|
-
OPERATIONS: {
|
|
765
|
-
USE: "analytics.assistant.operations.use",
|
|
766
|
-
EXPORT: "analytics.assistant.operations.export",
|
|
767
|
-
EMAIL: "analytics.assistant.operations.email",
|
|
768
|
-
},
|
|
769
|
-
},
|
|
770
|
-
},
|
|
771
|
-
|
|
772
|
-
// ============================================
|
|
773
|
-
// AUTHORIZATION
|
|
774
|
-
// ============================================
|
|
775
|
-
AUTHORIZATION: {
|
|
776
|
-
ROLE: {
|
|
777
|
-
VIEW: "authorization.role.view",
|
|
778
|
-
CREATE: "authorization.role.create",
|
|
779
|
-
UPDATE: "authorization.role.update",
|
|
780
|
-
DELETE: "authorization.role.delete",
|
|
781
|
-
ASSIGN: "authorization.role.assign",
|
|
782
|
-
UNASSIGN: "authorization.role.unassign",
|
|
783
|
-
SYNC_DIRECT: "authorization.role.sync_direct",
|
|
784
|
-
SYNC_REQUEST: "authorization.role.sync_request",
|
|
785
|
-
},
|
|
786
|
-
PERMISSION: {
|
|
787
|
-
VIEW: "authorization.permission.view",
|
|
788
|
-
CREATE: "authorization.permission.create",
|
|
789
|
-
},
|
|
790
|
-
USER_DEALER_PERMISSION: {
|
|
791
|
-
VIEW: "authorization.user_dealer_permission.view",
|
|
792
|
-
ASSIGN: "authorization.user_dealer_permission.assign",
|
|
793
|
-
DELETE: "authorization.user_dealer_permission.delete",
|
|
794
|
-
},
|
|
795
|
-
},
|
|
796
|
-
|
|
797
|
-
// ============================================
|
|
798
|
-
// AUTOMATIC_ACTION
|
|
799
|
-
// ============================================
|
|
800
|
-
AUTOMATIC_ACTION: {
|
|
801
|
-
OPERATIONS: {
|
|
802
|
-
VIEW: "automatic_action.operations.view",
|
|
803
|
-
DELETE: "automatic_action.operations.delete",
|
|
804
|
-
EXECUTE: "automatic_action.operations.execute",
|
|
805
|
-
},
|
|
806
|
-
},
|
|
807
|
-
|
|
808
|
-
// ============================================
|
|
809
|
-
// CALENDAR
|
|
810
|
-
// ============================================
|
|
811
|
-
CALENDAR: {
|
|
812
|
-
OPERATIONS: {
|
|
813
|
-
VIEW: "calendar.operations.view",
|
|
814
|
-
UPDATE: "calendar.operations.update",
|
|
815
|
-
},
|
|
816
|
-
},
|
|
817
|
-
|
|
818
|
-
// ============================================
|
|
819
|
-
// NOTIFICATION
|
|
820
|
-
// ============================================
|
|
821
|
-
NOTIFICATION: {
|
|
822
|
-
ROUTING: {
|
|
823
|
-
VIEW: "notification.routing.view",
|
|
824
|
-
MANAGE: "notification.routing.manage",
|
|
825
|
-
},
|
|
826
|
-
CONFIG: {
|
|
827
|
-
VIEW: "notification.config.view",
|
|
828
|
-
MANAGE: "notification.config.manage",
|
|
829
|
-
},
|
|
830
|
-
},
|
|
831
|
-
|
|
832
|
-
// ============================================
|
|
833
|
-
// GPS PROVIDER
|
|
834
|
-
// ============================================
|
|
835
|
-
// ============================================
|
|
836
|
-
// OTHER (comments on client, wholesale, etc.)
|
|
837
|
-
// ============================================
|
|
838
|
-
OTHER: {
|
|
839
|
-
COMMENT: {
|
|
840
|
-
VIEW: "other.comment.view",
|
|
841
|
-
CREATE: "other.comment.create",
|
|
842
|
-
UPDATE: "other.comment.update",
|
|
843
|
-
DELETE: "other.comment.delete",
|
|
844
|
-
},
|
|
845
|
-
},
|
|
846
|
-
|
|
847
|
-
GPS_PROVIDER: {
|
|
848
|
-
CONFIG: {
|
|
849
|
-
OPERATIONS: {
|
|
850
|
-
CREATE: "gps-provider.config.operations.create",
|
|
851
|
-
VIEW: "gps-provider.config.operations.view",
|
|
852
|
-
UPDATE: "gps-provider.config.operations.update",
|
|
853
|
-
DELETE: "gps-provider.config.operations.delete",
|
|
854
|
-
},
|
|
855
|
-
},
|
|
856
|
-
DEVICE: {
|
|
857
|
-
OPERATIONS: {
|
|
858
|
-
VIEW: "gps-provider.device.operations.view",
|
|
859
|
-
LOCATE: "gps-provider.device.operations.locate",
|
|
860
|
-
ACTIVATE: "gps-provider.device.operations.activate",
|
|
861
|
-
RESET_MILEAGE: "gps-provider.device.operations.reset_mileage",
|
|
862
|
-
},
|
|
863
|
-
},
|
|
864
|
-
},
|
|
865
|
-
|
|
866
|
-
// ============================================
|
|
867
|
-
// CRM
|
|
868
|
-
// ============================================
|
|
869
|
-
CRM: {
|
|
870
|
-
CONVERSATION: {
|
|
871
|
-
OPERATIONS: {
|
|
872
|
-
VIEW: "crm.conversation.operations.view",
|
|
873
|
-
REPLY: "crm.conversation.operations.reply",
|
|
874
|
-
},
|
|
875
|
-
},
|
|
876
|
-
CALL: {
|
|
877
|
-
OPERATIONS: {
|
|
878
|
-
USE: "crm.call.operations.use",
|
|
879
|
-
},
|
|
880
|
-
},
|
|
881
|
-
},
|
|
882
|
-
} as const;
|
|
883
|
-
|
|
884
|
-
export type Permission = typeof PERMISSIONS;
|