@driveflux/auth 4.0.77 → 4.0.79
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/AuthProvider.d.ts +1 -0
- package/dist/AuthProvider.d.ts.map +1 -0
- package/dist/AuthProvider.js +76 -59
- package/dist/ability.d.ts +1 -0
- package/dist/ability.d.ts.map +1 -0
- package/dist/authorization/constants.d.ts +2 -1
- package/dist/authorization/constants.d.ts.map +1 -0
- package/dist/authorization/constants.js +45 -24
- package/dist/authorization/define.d.ts +1 -0
- package/dist/authorization/define.d.ts.map +1 -0
- package/dist/authorization/define.js +57 -28
- package/dist/authorization/fields/index.d.ts +1 -0
- package/dist/authorization/fields/index.d.ts.map +1 -0
- package/dist/authorization/fields/index.js +4 -7
- package/dist/authorization/helpers.d.ts +1 -0
- package/dist/authorization/helpers.d.ts.map +1 -0
- package/dist/authorization/helpers.js +10 -8
- package/dist/authorization/index.d.ts +1 -0
- package/dist/authorization/index.d.ts.map +1 -0
- package/dist/authorization/index.js +6 -6
- package/dist/authorization/permissions-list.d.ts +2 -0
- package/dist/authorization/permissions-list.d.ts.map +1 -0
- package/dist/authorization/permissions-list.js +6 -7
- package/dist/authorization/quick.d.ts +1 -0
- package/dist/authorization/quick.d.ts.map +1 -0
- package/dist/authorization/quick.js +1 -1
- package/dist/authorization/roles/admin/business-development-executive.d.ts +1 -0
- package/dist/authorization/roles/admin/business-development-executive.d.ts.map +1 -0
- package/dist/authorization/roles/admin/business-development-executive.js +20 -7
- package/dist/authorization/roles/admin/ceo.d.ts +1 -0
- package/dist/authorization/roles/admin/ceo.d.ts.map +1 -0
- package/dist/authorization/roles/admin/ceo.js +4 -2
- package/dist/authorization/roles/admin/common.d.ts +1 -0
- package/dist/authorization/roles/admin/common.d.ts.map +1 -0
- package/dist/authorization/roles/admin/common.js +7 -3
- package/dist/authorization/roles/admin/concierge.d.ts +1 -0
- package/dist/authorization/roles/admin/concierge.d.ts.map +1 -0
- package/dist/authorization/roles/admin/concierge.js +35 -10
- package/dist/authorization/roles/admin/customer-success-executive.d.ts +1 -0
- package/dist/authorization/roles/admin/customer-success-executive.d.ts.map +1 -0
- package/dist/authorization/roles/admin/customer-success-executive.js +40 -10
- package/dist/authorization/roles/admin/data-analyst.d.ts +1 -0
- package/dist/authorization/roles/admin/data-analyst.d.ts.map +1 -0
- package/dist/authorization/roles/admin/data-analyst.js +7 -4
- package/dist/authorization/roles/admin/designer.d.ts +1 -0
- package/dist/authorization/roles/admin/designer.d.ts.map +1 -0
- package/dist/authorization/roles/admin/designer.js +7 -4
- package/dist/authorization/roles/admin/engineer.d.ts +1 -0
- package/dist/authorization/roles/admin/engineer.d.ts.map +1 -0
- package/dist/authorization/roles/admin/engineer.js +7 -4
- package/dist/authorization/roles/admin/finance-executive.d.ts +1 -0
- package/dist/authorization/roles/admin/finance-executive.d.ts.map +1 -0
- package/dist/authorization/roles/admin/finance-executive.js +11 -4
- package/dist/authorization/roles/admin/head-of-business-development.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-business-development.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-business-development.js +14 -4
- package/dist/authorization/roles/admin/head-of-data-analytics.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-data-analytics.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-data-analytics.js +14 -4
- package/dist/authorization/roles/admin/head-of-engineering.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-engineering.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-engineering.js +17 -6
- package/dist/authorization/roles/admin/head-of-finance.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-finance.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-finance.js +8 -3
- package/dist/authorization/roles/admin/head-of-human-resources.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-human-resources.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-human-resources.js +13 -5
- package/dist/authorization/roles/admin/head-of-marketing.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-marketing.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-marketing.js +17 -5
- package/dist/authorization/roles/admin/head-of-operations.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-operations.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-operations.js +8 -3
- package/dist/authorization/roles/admin/head-of-product.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-product.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-product.js +17 -6
- package/dist/authorization/roles/admin/head-of-sales.d.ts +1 -0
- package/dist/authorization/roles/admin/head-of-sales.d.ts.map +1 -0
- package/dist/authorization/roles/admin/head-of-sales.js +17 -5
- package/dist/authorization/roles/admin/human-resources-executive.d.ts +1 -0
- package/dist/authorization/roles/admin/human-resources-executive.d.ts.map +1 -0
- package/dist/authorization/roles/admin/human-resources-executive.js +12 -5
- package/dist/authorization/roles/admin/marketing-executive.d.ts +1 -0
- package/dist/authorization/roles/admin/marketing-executive.d.ts.map +1 -0
- package/dist/authorization/roles/admin/marketing-executive.js +7 -4
- package/dist/authorization/roles/admin/product-manager.d.ts +1 -0
- package/dist/authorization/roles/admin/product-manager.d.ts.map +1 -0
- package/dist/authorization/roles/admin/product-manager.js +7 -4
- package/dist/authorization/roles/admin/sales-executive.d.ts +1 -0
- package/dist/authorization/roles/admin/sales-executive.d.ts.map +1 -0
- package/dist/authorization/roles/admin/sales-executive.js +24 -8
- package/dist/authorization/roles/consumer/business-admin.d.ts +1 -0
- package/dist/authorization/roles/consumer/business-admin.d.ts.map +1 -0
- package/dist/authorization/roles/consumer/business-admin.js +19 -6
- package/dist/authorization/roles/consumer/business-user.d.ts +1 -0
- package/dist/authorization/roles/consumer/business-user.d.ts.map +1 -0
- package/dist/authorization/roles/consumer/business-user.js +18 -6
- package/dist/authorization/roles/consumer/member.d.ts +1 -0
- package/dist/authorization/roles/consumer/member.d.ts.map +1 -0
- package/dist/authorization/roles/consumer/member.js +16 -6
- package/dist/authorization/types.d.ts +1 -0
- package/dist/authorization/types.d.ts.map +1 -0
- package/dist/authorization/types.js +1 -1
- package/dist/authorization/update-user-permissions.d.ts +1 -0
- package/dist/authorization/update-user-permissions.d.ts.map +1 -0
- package/dist/authorization/update-user-permissions.js +22 -15
- package/dist/authorization/utils.d.ts +1 -0
- package/dist/authorization/utils.d.ts.map +1 -0
- package/dist/authorization/utils.js +26 -11
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +2 -4
- package/dist/context.d.ts +1 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +8 -9
- package/dist/default.d.ts +1 -0
- package/dist/default.d.ts.map +1 -0
- package/dist/default.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/providers.d.ts +1 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/server/authenticate-user.d.ts +1 -0
- package/dist/server/authenticate-user.d.ts.map +1 -0
- package/dist/server/authenticate-user.js +11 -7
- package/dist/server/cors.d.ts +1 -0
- package/dist/server/cors.d.ts.map +1 -0
- package/dist/server/cors.js +23 -12
- package/dist/server/credentials-provider.d.ts +1 -0
- package/dist/server/credentials-provider.d.ts.map +1 -0
- package/dist/server/credentials-provider.js +2 -2
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/next-auth.d.ts +16 -15
- package/dist/server/next-auth.d.ts.map +1 -0
- package/dist/server/next-auth.js +104 -109
- package/dist/server/prisma-adapter.d.ts +1 -0
- package/dist/server/prisma-adapter.d.ts.map +1 -0
- package/dist/server/prisma-adapter.js +88 -52
- package/dist/server/types.d.ts +1 -0
- package/dist/server/types.d.ts.map +1 -0
- package/dist/server/verfiy-token.d.ts +1 -0
- package/dist/server/verfiy-token.d.ts.map +1 -0
- package/dist/server/verfiy-token.js +39 -24
- package/dist/translations.d.ts +1 -0
- package/dist/translations.d.ts.map +1 -0
- package/dist/translations.js +4 -4
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/use-auth.d.ts +1 -0
- package/dist/use-auth.d.ts.map +1 -0
- package/dist/use-auth.js +1 -1
- package/dist/use-session.d.ts +1 -0
- package/dist/use-session.d.ts.map +1 -0
- package/dist/use-session.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { s } from './utils.js';
|
|
2
|
-
export const getPermissionsFromAbility = (ability)
|
|
2
|
+
export const getPermissionsFromAbility = (ability)=>{
|
|
3
3
|
return {
|
|
4
4
|
// Lists
|
|
5
5
|
viewContractsList: ability.can('read', 'SubscriptionContract'),
|
|
@@ -18,6 +18,7 @@ export const getPermissionsFromAbility = (ability) => {
|
|
|
18
18
|
viewInquiriesList: ability.can('read', 'Inquiry'),
|
|
19
19
|
viewLogs: ability.can('read', 'Log'),
|
|
20
20
|
viewWebsiteSettings: ability.can('update', 'PlatformConfig'),
|
|
21
|
+
viewSystemEmailsList: ability.can('update', 'PlatformConfig'),
|
|
21
22
|
viewQuotationsList: ability.can('read', 'Quotation'),
|
|
22
23
|
viewCareerList: ability.can('read', 'Vacancy') && ability.can('read', 'Applicant'),
|
|
23
24
|
// Subscriptions
|
|
@@ -52,7 +53,7 @@ export const getPermissionsFromAbility = (ability) => {
|
|
|
52
53
|
updateVehicleServiceCenters: ability.can('update', 'Vehicle', 'allowedServiceCenterIds'),
|
|
53
54
|
readPricingInput: ability.can('readPricingInput', 'Vehicle'),
|
|
54
55
|
updatePricingInput: ability.can('update', 'Vehicle', 'pricing'),
|
|
55
|
-
testPricingInput: ability.can('testPricingInput', 'Vehicle'),
|
|
56
|
+
testPricingInput: ability.can('testPricingInput', 'Vehicle'),
|
|
56
57
|
// Users ( Members )
|
|
57
58
|
createMember: ability.can('create', 'User'),
|
|
58
59
|
updateMember: ability.can('update', s('User')),
|
|
@@ -83,8 +84,7 @@ export const getPermissionsFromAbility = (ability) => {
|
|
|
83
84
|
updateInvoice: ability.can('update', s('Invoice', 'payerId')),
|
|
84
85
|
cancelInvoice: ability.can('cancelInvoice', 'Invoice'),
|
|
85
86
|
markInvoiceAsPaid: ability.can('markInvoice', 'Invoice', 'paid'),
|
|
86
|
-
markInvoiceAsRefunded: ability.can('markInvoice', 'Invoice', 'totalRefunded') &&
|
|
87
|
-
ability.can('create', 'Refund'),
|
|
87
|
+
markInvoiceAsRefunded: ability.can('markInvoice', 'Invoice', 'totalRefunded') && ability.can('create', 'Refund'),
|
|
88
88
|
readPaymentMethodsUser: ability.can('read', s('User'), 'paymentMethods'),
|
|
89
89
|
readPaymentMethodsBusiness: ability.can('read', s('Business'), 'paymentMethods'),
|
|
90
90
|
addPaymentMethodUser: ability.can('update', s('User'), 'paymentMethods'),
|
|
@@ -132,8 +132,7 @@ export const getPermissionsFromAbility = (ability) => {
|
|
|
132
132
|
// TODO add logs permision or remove the comments
|
|
133
133
|
// Logs
|
|
134
134
|
// Website Settings
|
|
135
|
-
uploadBanners: ability.can('update', 'PlatformConfig') &&
|
|
136
|
-
ability.can('create', 'PlatformConfig'),
|
|
135
|
+
uploadBanners: ability.can('update', 'PlatformConfig') && ability.can('create', 'PlatformConfig'),
|
|
137
136
|
deleteBanners: ability.can('update', 'PlatformConfig'),
|
|
138
137
|
// Quotations
|
|
139
138
|
createQuotation: ability.can('create', 'Quotation'),
|
|
@@ -142,6 +141,6 @@ export const getPermissionsFromAbility = (ability) => {
|
|
|
142
141
|
createVacancy: ability.can('create', 'Vacancy'),
|
|
143
142
|
updateVacancy: ability.can('update', 'Vacancy'),
|
|
144
143
|
readApplicant: ability.can('read', 'Applicant'),
|
|
145
|
-
readVacancy: ability.can('read', 'Vacancy')
|
|
144
|
+
readVacancy: ability.can('read', 'Vacancy')
|
|
146
145
|
};
|
|
147
146
|
};
|
|
@@ -3,3 +3,4 @@ import type { Models } from '@driveflux/db/types';
|
|
|
3
3
|
import type { FrontendModel } from '@driveflux/db/types/frontend';
|
|
4
4
|
export declare function buildAbilityFromJson(user: Pick<User | FrontendModel<'User'> | Models<'User'>, 'permissions'>): import("@casl/ability").PureAbility<any, any>;
|
|
5
5
|
export default buildAbilityFromJson;
|
|
6
|
+
//# sourceMappingURL=quick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick.d.ts","sourceRoot":"","sources":["../../src/authorization/quick.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAGjE,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,iDAKxE;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { createPrismaAbility } from '@casl/prisma';
|
|
|
2
2
|
import { detectSubjectType } from './utils.js';
|
|
3
3
|
export function buildAbilityFromJson(user) {
|
|
4
4
|
return createPrismaAbility(user.permissions, {
|
|
5
|
-
detectSubjectType
|
|
5
|
+
detectSubjectType
|
|
6
6
|
});
|
|
7
7
|
}
|
|
8
8
|
export default buildAbilityFromJson;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesBusinessDevelopmentExecutive: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=business-development-executive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"business-development-executive.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/business-development-executive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,eAAO,MAAM,+CAA+C,GAC3D,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAqC5C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocumentsFields } from '../../utils.js';
|
|
2
|
-
export const defineRoleAbilitiesBusinessDevelopmentExecutive = async (can, cannot)
|
|
2
|
+
export const defineRoleAbilitiesBusinessDevelopmentExecutive = async (can, cannot)=>{
|
|
3
3
|
can('read', [
|
|
4
4
|
'Subscription',
|
|
5
5
|
'Vehicle',
|
|
@@ -13,22 +13,35 @@ export const defineRoleAbilitiesBusinessDevelopmentExecutive = async (can, canno
|
|
|
13
13
|
'PaymentLink',
|
|
14
14
|
'Invoice',
|
|
15
15
|
'Transaction',
|
|
16
|
-
'Refund'
|
|
16
|
+
'Refund'
|
|
17
17
|
]);
|
|
18
18
|
cannot('update', 'Invoice');
|
|
19
|
-
can('manage', [
|
|
19
|
+
can('manage', [
|
|
20
|
+
'Vehicle',
|
|
21
|
+
'ServiceCenter',
|
|
22
|
+
'Host',
|
|
23
|
+
'Inquiry',
|
|
24
|
+
'Token'
|
|
25
|
+
]);
|
|
20
26
|
can('readPricingInput', 'Vehicle');
|
|
21
27
|
can('connectHostToStripe', 'Host');
|
|
22
|
-
can('update', 'Subscription', [
|
|
28
|
+
can('update', 'Subscription', [
|
|
29
|
+
'vehicleId'
|
|
30
|
+
]);
|
|
23
31
|
cannot('read', 'User', 'status');
|
|
24
32
|
cannot('read', 'User', [
|
|
25
33
|
...getDocumentsFields('identification'),
|
|
26
34
|
...getDocumentsFields('drivingHistory'),
|
|
27
35
|
...getDocumentsFields('financial'),
|
|
28
|
-
...getDocumentsFields('offerLetter')
|
|
36
|
+
...getDocumentsFields('offerLetter')
|
|
37
|
+
]);
|
|
38
|
+
can([
|
|
39
|
+
'viewSubscriptionApproval'
|
|
40
|
+
], 'Subscription');
|
|
41
|
+
cannot('read', [
|
|
42
|
+
'Vacancy',
|
|
43
|
+
'Applicant'
|
|
29
44
|
]);
|
|
30
|
-
can(['viewSubscriptionApproval'], 'Subscription');
|
|
31
|
-
cannot('read', ['Vacancy', 'Applicant']);
|
|
32
45
|
can('read', 'Activity');
|
|
33
46
|
can('read', 'ActivityTask');
|
|
34
47
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ceo.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/ceo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,sBAAsB,GAClC,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,kBAGtC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,8BAA8B,GAC1C,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,kBAKtC,CAAA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export const defineRoleAbilitiesCommonAdmin = async (can) => {
|
|
2
|
-
can(['read'],
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
can(['read'], [
|
|
3
|
+
'Log',
|
|
4
|
+
'Issue',
|
|
5
|
+
'SubscriptionContract',
|
|
6
|
+
'HostContribution',
|
|
7
|
+
'SubscriptionEvent',
|
|
8
|
+
]);
|
|
5
9
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesConcierge: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=concierge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concierge.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/concierge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,eAAO,MAAM,4BAA4B,GACxC,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBA6C5C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocumentsFields } from '../../utils.js';
|
|
2
|
-
export const defineRoleAbilitiesConcierge = async (can, cannot)
|
|
2
|
+
export const defineRoleAbilitiesConcierge = async (can, cannot)=>{
|
|
3
3
|
can('read', [
|
|
4
4
|
'Subscription',
|
|
5
5
|
'Cycle',
|
|
@@ -12,11 +12,14 @@ export const defineRoleAbilitiesConcierge = async (can, cannot) => {
|
|
|
12
12
|
'Inquiry',
|
|
13
13
|
'Discount',
|
|
14
14
|
'PlatformConfig',
|
|
15
|
-
'PaymentLink'
|
|
15
|
+
'PaymentLink'
|
|
16
16
|
]);
|
|
17
17
|
cannot('create', 'Business');
|
|
18
18
|
can('manage', 'ServiceCenter');
|
|
19
|
-
can('update', 'Vehicle', [
|
|
19
|
+
can('update', 'Vehicle', [
|
|
20
|
+
'images',
|
|
21
|
+
'allowedServiceCenterIds'
|
|
22
|
+
]);
|
|
20
23
|
can('readPricingInput', 'Vehicle');
|
|
21
24
|
can('update', 'Host', 'serviceCenterIds');
|
|
22
25
|
can('manage', 'Subscription');
|
|
@@ -30,16 +33,38 @@ export const defineRoleAbilitiesConcierge = async (can, cannot) => {
|
|
|
30
33
|
'payerType',
|
|
31
34
|
'driversIds',
|
|
32
35
|
'drivers',
|
|
33
|
-
'vehicleId'
|
|
36
|
+
'vehicleId'
|
|
37
|
+
]);
|
|
38
|
+
can([
|
|
39
|
+
'read'
|
|
40
|
+
], [
|
|
41
|
+
'Invoice',
|
|
42
|
+
'Transaction',
|
|
43
|
+
'Refund'
|
|
34
44
|
]);
|
|
35
|
-
can(['read'], ['Invoice', 'Transaction', 'Refund']);
|
|
36
45
|
cannot('read', 'User', [
|
|
37
46
|
...getDocumentsFields('drivingHistory'),
|
|
38
47
|
...getDocumentsFields('financial'),
|
|
39
|
-
...getDocumentsFields('offerLetter')
|
|
48
|
+
...getDocumentsFields('offerLetter')
|
|
49
|
+
]);
|
|
50
|
+
can([
|
|
51
|
+
'manage'
|
|
52
|
+
], [
|
|
53
|
+
'Activity',
|
|
54
|
+
'ActivityTask'
|
|
55
|
+
]);
|
|
56
|
+
cannot([
|
|
57
|
+
'create',
|
|
58
|
+
'delete'
|
|
59
|
+
], [
|
|
60
|
+
'Activity',
|
|
61
|
+
'ActivityTask'
|
|
62
|
+
]);
|
|
63
|
+
can([
|
|
64
|
+
'viewSubscriptionApproval'
|
|
65
|
+
], 'Subscription');
|
|
66
|
+
cannot('read', [
|
|
67
|
+
'Vacancy',
|
|
68
|
+
'Applicant'
|
|
40
69
|
]);
|
|
41
|
-
can(['manage'], ['Activity', 'ActivityTask']);
|
|
42
|
-
cannot(['create', 'delete'], ['Activity', 'ActivityTask']);
|
|
43
|
-
can(['viewSubscriptionApproval'], 'Subscription');
|
|
44
|
-
cannot('read', ['Vacancy', 'Applicant']);
|
|
45
70
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesCustomerSuccessExecutive: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=customer-success-executive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer-success-executive.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/customer-success-executive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,2CAA2C,GACvD,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBA+B5C,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const defineRoleAbilitiesCustomerSuccessExecutive = async (can, cannot)
|
|
1
|
+
export const defineRoleAbilitiesCustomerSuccessExecutive = async (can, cannot)=>{
|
|
2
2
|
can('manage', [
|
|
3
3
|
'Subscription',
|
|
4
4
|
'Cycle',
|
|
@@ -14,17 +14,47 @@ export const defineRoleAbilitiesCustomerSuccessExecutive = async (can, cannot) =
|
|
|
14
14
|
'Token',
|
|
15
15
|
'PaymentLink',
|
|
16
16
|
'Activity',
|
|
17
|
-
'ActivityTask'
|
|
17
|
+
'ActivityTask'
|
|
18
18
|
]);
|
|
19
19
|
can('read', 'PlatformConfig');
|
|
20
|
-
can([
|
|
20
|
+
can([
|
|
21
|
+
'create',
|
|
22
|
+
'read',
|
|
23
|
+
'update'
|
|
24
|
+
], [
|
|
25
|
+
'Invoice',
|
|
26
|
+
'Transaction',
|
|
27
|
+
'Refund'
|
|
28
|
+
]);
|
|
21
29
|
can('connectHostToStripe', 'Host');
|
|
22
|
-
cannot('update', 'Vehicle', [
|
|
30
|
+
cannot('update', 'Vehicle', [
|
|
31
|
+
'pricing',
|
|
32
|
+
'basePrice'
|
|
33
|
+
]);
|
|
23
34
|
can('readPricingInput', 'Vehicle');
|
|
24
|
-
can('markInvoice', 'Invoice', [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
cannot([
|
|
29
|
-
|
|
35
|
+
can('markInvoice', 'Invoice', [
|
|
36
|
+
'totalRefunded',
|
|
37
|
+
'paid'
|
|
38
|
+
]);
|
|
39
|
+
cannot([
|
|
40
|
+
'release',
|
|
41
|
+
'reverse',
|
|
42
|
+
'deletePayoutChargeLine'
|
|
43
|
+
], 'Payout');
|
|
44
|
+
cannot([
|
|
45
|
+
'create',
|
|
46
|
+
'update',
|
|
47
|
+
'delete'
|
|
48
|
+
], 'Coupon');
|
|
49
|
+
can([
|
|
50
|
+
'viewSubscriptionApproval'
|
|
51
|
+
], 'Subscription');
|
|
52
|
+
cannot([
|
|
53
|
+
'update',
|
|
54
|
+
'delete'
|
|
55
|
+
], 'Inquiry');
|
|
56
|
+
cannot('read', [
|
|
57
|
+
'Vacancy',
|
|
58
|
+
'Applicant'
|
|
59
|
+
]);
|
|
30
60
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesDataAnalyst: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=data-analyst.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-analyst.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/data-analyst.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,eAAO,MAAM,8BAA8B,GAC1C,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBA0B5C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocumentsFields } from '../../utils.js';
|
|
2
|
-
export const defineRoleAbilitiesDataAnalyst = async (can, cannot)
|
|
2
|
+
export const defineRoleAbilitiesDataAnalyst = async (can, cannot)=>{
|
|
3
3
|
can('read', [
|
|
4
4
|
'Subscription',
|
|
5
5
|
'Cycle',
|
|
@@ -11,17 +11,20 @@ export const defineRoleAbilitiesDataAnalyst = async (can, cannot) => {
|
|
|
11
11
|
'ServiceCenter',
|
|
12
12
|
'Coupon',
|
|
13
13
|
'Discount',
|
|
14
|
-
'PlatformConfig'
|
|
14
|
+
'PlatformConfig'
|
|
15
15
|
]);
|
|
16
16
|
cannot('read', 'User', [
|
|
17
17
|
...getDocumentsFields('identification'),
|
|
18
18
|
...getDocumentsFields('drivingHistory'),
|
|
19
19
|
...getDocumentsFields('financial'),
|
|
20
|
-
...getDocumentsFields('offerLetter')
|
|
20
|
+
...getDocumentsFields('offerLetter')
|
|
21
21
|
]);
|
|
22
22
|
cannot('create', 'Business');
|
|
23
23
|
cannot('read', 'Business', 'paymentMethods');
|
|
24
24
|
cannot('read', 'User', 'paymentMethods');
|
|
25
25
|
cannot('read', 'Invoice');
|
|
26
|
-
cannot('read', [
|
|
26
|
+
cannot('read', [
|
|
27
|
+
'Vacancy',
|
|
28
|
+
'Applicant'
|
|
29
|
+
]);
|
|
27
30
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesDesigner: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=designer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"designer.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/designer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,eAAO,MAAM,2BAA2B,GACvC,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBA0B5C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocumentsFields } from '../../utils.js';
|
|
2
|
-
export const defineRoleAbilitiesDesigner = async (can, cannot)
|
|
2
|
+
export const defineRoleAbilitiesDesigner = async (can, cannot)=>{
|
|
3
3
|
can('read', [
|
|
4
4
|
'Subscription',
|
|
5
5
|
'Cycle',
|
|
@@ -11,17 +11,20 @@ export const defineRoleAbilitiesDesigner = async (can, cannot) => {
|
|
|
11
11
|
'ServiceCenter',
|
|
12
12
|
'Coupon',
|
|
13
13
|
'Discount',
|
|
14
|
-
'PlatformConfig'
|
|
14
|
+
'PlatformConfig'
|
|
15
15
|
]);
|
|
16
16
|
cannot('read', 'User', [
|
|
17
17
|
...getDocumentsFields('identification'),
|
|
18
18
|
...getDocumentsFields('drivingHistory'),
|
|
19
19
|
...getDocumentsFields('financial'),
|
|
20
|
-
...getDocumentsFields('offerLetter')
|
|
20
|
+
...getDocumentsFields('offerLetter')
|
|
21
21
|
]);
|
|
22
22
|
cannot('create', 'Business');
|
|
23
23
|
cannot('read', 'Business', 'paymentMethods');
|
|
24
24
|
cannot('read', 'User', 'paymentMethods');
|
|
25
25
|
cannot('read', 'Invoice');
|
|
26
|
-
cannot('read', [
|
|
26
|
+
cannot('read', [
|
|
27
|
+
'Vacancy',
|
|
28
|
+
'Applicant'
|
|
29
|
+
]);
|
|
27
30
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesEngineer: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=engineer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engineer.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/engineer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,eAAO,MAAM,2BAA2B,GACvC,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBA2B5C,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocumentsFields } from '../../utils.js';
|
|
2
|
-
export const defineRoleAbilitiesEngineer = async (can, cannot)
|
|
2
|
+
export const defineRoleAbilitiesEngineer = async (can, cannot)=>{
|
|
3
3
|
can('read', [
|
|
4
4
|
'Subscription',
|
|
5
5
|
'Cycle',
|
|
@@ -12,17 +12,20 @@ export const defineRoleAbilitiesEngineer = async (can, cannot) => {
|
|
|
12
12
|
'Coupon',
|
|
13
13
|
'Discount',
|
|
14
14
|
'PlatformConfig',
|
|
15
|
-
'Log'
|
|
15
|
+
'Log'
|
|
16
16
|
]);
|
|
17
17
|
cannot('read', 'User', [
|
|
18
18
|
...getDocumentsFields('identification'),
|
|
19
19
|
...getDocumentsFields('drivingHistory'),
|
|
20
20
|
...getDocumentsFields('financial'),
|
|
21
|
-
...getDocumentsFields('offerLetter')
|
|
21
|
+
...getDocumentsFields('offerLetter')
|
|
22
22
|
]);
|
|
23
23
|
cannot('create', 'Business');
|
|
24
24
|
cannot('read', 'Business', 'paymentMethods');
|
|
25
25
|
cannot('read', 'User', 'paymentMethods');
|
|
26
26
|
cannot('read', 'Invoice');
|
|
27
|
-
cannot('read', [
|
|
27
|
+
cannot('read', [
|
|
28
|
+
'Vacancy',
|
|
29
|
+
'Applicant'
|
|
30
|
+
]);
|
|
28
31
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesFinanceExecutive: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=finance-executive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finance-executive.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/finance-executive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,mCAAmC,GAC/C,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAyB5C,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const defineRoleAbilitiesFinanceExecutive = async (can, cannot)
|
|
1
|
+
export const defineRoleAbilitiesFinanceExecutive = async (can, cannot)=>{
|
|
2
2
|
can('read', [
|
|
3
3
|
'User',
|
|
4
4
|
'Subscription',
|
|
@@ -14,12 +14,19 @@ export const defineRoleAbilitiesFinanceExecutive = async (can, cannot) => {
|
|
|
14
14
|
'Invoice',
|
|
15
15
|
'Transaction',
|
|
16
16
|
'Refund',
|
|
17
|
-
'PaymentLink'
|
|
17
|
+
'PaymentLink'
|
|
18
|
+
]);
|
|
19
|
+
can('manage', [
|
|
20
|
+
'OffPlatformTransaction',
|
|
21
|
+
'Payout',
|
|
22
|
+
'Reports'
|
|
18
23
|
]);
|
|
19
|
-
can('manage', ['OffPlatformTransaction', 'Payout', 'Reports']);
|
|
20
24
|
can('create', 'Host');
|
|
21
25
|
cannot('cancelInvoice', 'Invoice');
|
|
22
26
|
cannot('markInvoice', 'Invoice');
|
|
23
27
|
can('readPricingInput', 'Vehicle');
|
|
24
|
-
cannot('read', [
|
|
28
|
+
cannot('read', [
|
|
29
|
+
'Vacancy',
|
|
30
|
+
'Applicant'
|
|
31
|
+
]);
|
|
25
32
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesHeadOfBusinessDevelopment: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=head-of-business-development.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head-of-business-development.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-business-development.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,4CAA4C,GACxD,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAU5C,CAAA"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
export const defineRoleAbilitiesHeadOfBusinessDevelopment = async (can, cannot)
|
|
1
|
+
export const defineRoleAbilitiesHeadOfBusinessDevelopment = async (can, cannot)=>{
|
|
2
2
|
can('manage', 'all');
|
|
3
|
-
cannot([
|
|
4
|
-
|
|
3
|
+
cannot([
|
|
4
|
+
'create',
|
|
5
|
+
'update'
|
|
6
|
+
], 'Payout');
|
|
7
|
+
cannot([
|
|
8
|
+
'release',
|
|
9
|
+
'reverse',
|
|
10
|
+
'deletePayoutChargeLine'
|
|
11
|
+
], 'Payout');
|
|
5
12
|
cannot('cancelInvoice', 'Invoice');
|
|
6
13
|
cannot('markInvoice', 'Invoice');
|
|
7
|
-
cannot('manage', [
|
|
14
|
+
cannot('manage', [
|
|
15
|
+
'Vacancy',
|
|
16
|
+
'Applicant'
|
|
17
|
+
]);
|
|
8
18
|
can('updateSubscriptionUser', 'Subscription');
|
|
9
19
|
can('manageAdmin', 'Reports');
|
|
10
20
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesHeadOfDataAnalytics: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=head-of-data-analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head-of-data-analytics.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-data-analytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,sCAAsC,GAClD,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAS5C,CAAA"}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
export const defineRoleAbilitiesHeadOfDataAnalytics = async (can, cannot)
|
|
1
|
+
export const defineRoleAbilitiesHeadOfDataAnalytics = async (can, cannot)=>{
|
|
2
2
|
can('manage', 'all');
|
|
3
|
-
cannot([
|
|
4
|
-
|
|
3
|
+
cannot([
|
|
4
|
+
'create',
|
|
5
|
+
'update'
|
|
6
|
+
], 'Payout');
|
|
7
|
+
cannot([
|
|
8
|
+
'release',
|
|
9
|
+
'reverse',
|
|
10
|
+
'deletePayoutChargeLine'
|
|
11
|
+
], 'Payout');
|
|
5
12
|
cannot('cancelInvoice', 'Invoice');
|
|
6
13
|
cannot('markInvoice', 'Invoice');
|
|
7
14
|
cannot('update', 'Host', 'accountManagerId');
|
|
8
|
-
cannot('manage', [
|
|
15
|
+
cannot('manage', [
|
|
16
|
+
'Vacancy',
|
|
17
|
+
'Applicant'
|
|
18
|
+
]);
|
|
9
19
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesHeadOfEngineering: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=head-of-engineering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head-of-engineering.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-engineering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,oCAAoC,GAChD,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAW5C,CAAA"}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import { OWNER_ROLES } from '../../constants.js';
|
|
2
|
-
export const defineRoleAbilitiesHeadOfEngineering = async (can, cannot)
|
|
2
|
+
export const defineRoleAbilitiesHeadOfEngineering = async (can, cannot)=>{
|
|
3
3
|
can('manage', 'all');
|
|
4
|
-
cannot([
|
|
4
|
+
cannot([
|
|
5
|
+
'create',
|
|
6
|
+
'update',
|
|
7
|
+
'delete'
|
|
8
|
+
], 'User', undefined, {
|
|
5
9
|
groups: {
|
|
6
|
-
hasSome: [
|
|
7
|
-
|
|
10
|
+
hasSome: [
|
|
11
|
+
...OWNER_ROLES
|
|
12
|
+
]
|
|
13
|
+
}
|
|
8
14
|
});
|
|
9
|
-
cannot('update', 'Host', [
|
|
10
|
-
|
|
15
|
+
cannot('update', 'Host', [
|
|
16
|
+
'accountManagerId'
|
|
17
|
+
]);
|
|
18
|
+
cannot('manage', [
|
|
19
|
+
'Vacancy',
|
|
20
|
+
'Applicant'
|
|
21
|
+
]);
|
|
11
22
|
can('manageAdmin', 'Reports');
|
|
12
23
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { AbilityBuilder } from '@casl/ability';
|
|
2
2
|
import type { AppAbility } from '../../types.js';
|
|
3
3
|
export declare const defineRoleAbilitiesHeadOfFinance: (can: AbilityBuilder<AppAbility>["can"], cannot: AbilityBuilder<AppAbility>["cannot"]) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=head-of-finance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head-of-finance.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-finance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,gCAAgC,GAC5C,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAM5C,CAAA"}
|