@driveflux/auth 4.0.62 → 4.0.64
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.js +59 -76
- package/dist/authorization/constants.js +24 -45
- package/dist/authorization/define.js +28 -57
- package/dist/authorization/fields/index.js +7 -4
- package/dist/authorization/helpers.js +8 -10
- package/dist/authorization/index.js +6 -6
- package/dist/authorization/permissions-list.js +7 -5
- package/dist/authorization/quick.js +1 -1
- package/dist/authorization/roles/admin/business-development-executive.js +7 -20
- package/dist/authorization/roles/admin/ceo.js +2 -4
- package/dist/authorization/roles/admin/common.js +2 -4
- package/dist/authorization/roles/admin/concierge.js +10 -35
- package/dist/authorization/roles/admin/customer-success-executive.js +10 -40
- package/dist/authorization/roles/admin/data-analyst.js +4 -7
- package/dist/authorization/roles/admin/designer.js +4 -7
- package/dist/authorization/roles/admin/engineer.js +4 -7
- package/dist/authorization/roles/admin/finance-executive.js +4 -11
- package/dist/authorization/roles/admin/head-of-business-development.d.ts.map +1 -1
- package/dist/authorization/roles/admin/head-of-business-development.js +4 -14
- package/dist/authorization/roles/admin/head-of-data-analytics.js +4 -14
- package/dist/authorization/roles/admin/head-of-engineering.d.ts.map +1 -1
- package/dist/authorization/roles/admin/head-of-engineering.js +6 -17
- package/dist/authorization/roles/admin/head-of-finance.d.ts.map +1 -1
- package/dist/authorization/roles/admin/head-of-finance.js +3 -8
- package/dist/authorization/roles/admin/head-of-human-resources.d.ts.map +1 -1
- package/dist/authorization/roles/admin/head-of-human-resources.js +5 -13
- package/dist/authorization/roles/admin/head-of-marketing.d.ts.map +1 -1
- package/dist/authorization/roles/admin/head-of-marketing.js +5 -17
- package/dist/authorization/roles/admin/head-of-operations.d.ts.map +1 -1
- package/dist/authorization/roles/admin/head-of-operations.js +3 -8
- package/dist/authorization/roles/admin/head-of-product.d.ts.map +1 -1
- package/dist/authorization/roles/admin/head-of-product.js +6 -17
- package/dist/authorization/roles/admin/head-of-sales.d.ts.map +1 -1
- package/dist/authorization/roles/admin/head-of-sales.js +5 -17
- package/dist/authorization/roles/admin/human-resources-executive.js +5 -12
- package/dist/authorization/roles/admin/marketing-executive.js +4 -7
- package/dist/authorization/roles/admin/product-manager.js +4 -7
- package/dist/authorization/roles/admin/sales-executive.js +8 -24
- package/dist/authorization/roles/consumer/business-admin.js +6 -19
- package/dist/authorization/roles/consumer/business-user.js +6 -18
- package/dist/authorization/roles/consumer/member.js +6 -16
- package/dist/authorization/types.js +1 -1
- package/dist/authorization/update-user-permissions.js +15 -22
- package/dist/authorization/utils.js +11 -26
- package/dist/constants.d.ts +8 -8
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -1
- package/dist/context.js +9 -8
- package/dist/default.js +1 -1
- package/dist/server/authenticate-user.js +7 -11
- package/dist/server/cors.js +12 -23
- package/dist/server/credentials-provider.js +2 -2
- package/dist/server/next-auth.d.ts +7 -7
- package/dist/server/next-auth.d.ts.map +1 -1
- package/dist/server/next-auth.js +109 -104
- package/dist/server/prisma-adapter.js +52 -88
- package/dist/server/verfiy-token.js +24 -39
- package/dist/translations.js +4 -4
- package/dist/use-auth.js +1 -1
- package/dist/use-session.js +1 -1
- package/package.json +2 -2
|
@@ -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,14 +12,11 @@ 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', [
|
|
20
|
-
'images',
|
|
21
|
-
'allowedServiceCenterIds'
|
|
22
|
-
]);
|
|
19
|
+
can('update', 'Vehicle', ['images', 'allowedServiceCenterIds']);
|
|
23
20
|
can('readPricingInput', 'Vehicle');
|
|
24
21
|
can('update', 'Host', 'serviceCenterIds');
|
|
25
22
|
can('manage', 'Subscription');
|
|
@@ -33,38 +30,16 @@ export const defineRoleAbilitiesConcierge = async (can, cannot)=>{
|
|
|
33
30
|
'payerType',
|
|
34
31
|
'driversIds',
|
|
35
32
|
'drivers',
|
|
36
|
-
'vehicleId'
|
|
37
|
-
]);
|
|
38
|
-
can([
|
|
39
|
-
'read'
|
|
40
|
-
], [
|
|
41
|
-
'Invoice',
|
|
42
|
-
'Transaction',
|
|
43
|
-
'Refund'
|
|
33
|
+
'vehicleId',
|
|
44
34
|
]);
|
|
35
|
+
can(['read'], ['Invoice', 'Transaction', 'Refund']);
|
|
45
36
|
cannot('read', 'User', [
|
|
46
37
|
...getDocumentsFields('drivingHistory'),
|
|
47
38
|
...getDocumentsFields('financial'),
|
|
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'
|
|
39
|
+
...getDocumentsFields('offerLetter'),
|
|
69
40
|
]);
|
|
41
|
+
can(['manage'], ['Activity', 'ActivityTask']);
|
|
42
|
+
cannot(['create', 'delete'], ['Activity', 'ActivityTask']);
|
|
43
|
+
can(['viewSubscriptionApproval'], 'Subscription');
|
|
44
|
+
cannot('read', ['Vacancy', 'Applicant']);
|
|
70
45
|
};
|
|
@@ -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,47 +14,17 @@ 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([
|
|
21
|
-
'create',
|
|
22
|
-
'read',
|
|
23
|
-
'update'
|
|
24
|
-
], [
|
|
25
|
-
'Invoice',
|
|
26
|
-
'Transaction',
|
|
27
|
-
'Refund'
|
|
28
|
-
]);
|
|
20
|
+
can(['create', 'read', 'update'], ['Invoice', 'Transaction', 'Refund']);
|
|
29
21
|
can('connectHostToStripe', 'Host');
|
|
30
|
-
cannot('update', 'Vehicle', [
|
|
31
|
-
'pricing',
|
|
32
|
-
'basePrice'
|
|
33
|
-
]);
|
|
22
|
+
cannot('update', 'Vehicle', ['pricing', 'basePrice']);
|
|
34
23
|
can('readPricingInput', 'Vehicle');
|
|
35
|
-
can('markInvoice', 'Invoice', [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
]);
|
|
39
|
-
cannot([
|
|
40
|
-
|
|
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
|
-
]);
|
|
24
|
+
can('markInvoice', 'Invoice', ['totalRefunded', 'paid']);
|
|
25
|
+
cannot(['release', 'reverse', 'deletePayoutChargeLine'], 'Payout');
|
|
26
|
+
cannot(['create', 'update', 'delete'], 'Coupon');
|
|
27
|
+
can(['viewSubscriptionApproval'], 'Subscription');
|
|
28
|
+
cannot(['update', 'delete'], 'Inquiry');
|
|
29
|
+
cannot('read', ['Vacancy', 'Applicant']);
|
|
60
30
|
};
|
|
@@ -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,20 +11,17 @@ 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', [
|
|
27
|
-
'Vacancy',
|
|
28
|
-
'Applicant'
|
|
29
|
-
]);
|
|
26
|
+
cannot('read', ['Vacancy', 'Applicant']);
|
|
30
27
|
};
|
|
@@ -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,20 +11,17 @@ 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', [
|
|
27
|
-
'Vacancy',
|
|
28
|
-
'Applicant'
|
|
29
|
-
]);
|
|
26
|
+
cannot('read', ['Vacancy', 'Applicant']);
|
|
30
27
|
};
|
|
@@ -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,20 +12,17 @@ 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', [
|
|
28
|
-
'Vacancy',
|
|
29
|
-
'Applicant'
|
|
30
|
-
]);
|
|
27
|
+
cannot('read', ['Vacancy', 'Applicant']);
|
|
31
28
|
};
|
|
@@ -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,19 +14,12 @@ export const defineRoleAbilitiesFinanceExecutive = async (can, cannot)=>{
|
|
|
14
14
|
'Invoice',
|
|
15
15
|
'Transaction',
|
|
16
16
|
'Refund',
|
|
17
|
-
'PaymentLink'
|
|
18
|
-
]);
|
|
19
|
-
can('manage', [
|
|
20
|
-
'OffPlatformTransaction',
|
|
21
|
-
'Payout',
|
|
22
|
-
'Reports'
|
|
17
|
+
'PaymentLink',
|
|
23
18
|
]);
|
|
19
|
+
can('manage', ['OffPlatformTransaction', 'Payout', 'Reports']);
|
|
24
20
|
can('create', 'Host');
|
|
25
21
|
cannot('cancelInvoice', 'Invoice');
|
|
26
22
|
cannot('markInvoice', 'Invoice');
|
|
27
23
|
can('readPricingInput', 'Vehicle');
|
|
28
|
-
cannot('read', [
|
|
29
|
-
'Vacancy',
|
|
30
|
-
'Applicant'
|
|
31
|
-
]);
|
|
24
|
+
cannot('read', ['Vacancy', 'Applicant']);
|
|
32
25
|
};
|
|
@@ -1 +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,
|
|
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,20 +1,10 @@
|
|
|
1
|
-
export const defineRoleAbilitiesHeadOfBusinessDevelopment = async (can, cannot)=>{
|
|
1
|
+
export const defineRoleAbilitiesHeadOfBusinessDevelopment = async (can, cannot) => {
|
|
2
2
|
can('manage', 'all');
|
|
3
|
-
cannot([
|
|
4
|
-
|
|
5
|
-
'update'
|
|
6
|
-
], 'Payout');
|
|
7
|
-
cannot([
|
|
8
|
-
'release',
|
|
9
|
-
'reverse',
|
|
10
|
-
'deletePayoutChargeLine'
|
|
11
|
-
], 'Payout');
|
|
3
|
+
cannot(['create', 'update'], 'Payout');
|
|
4
|
+
cannot(['release', 'reverse', 'deletePayoutChargeLine'], 'Payout');
|
|
12
5
|
cannot('cancelInvoice', 'Invoice');
|
|
13
6
|
cannot('markInvoice', 'Invoice');
|
|
14
|
-
cannot('manage', [
|
|
15
|
-
'Vacancy',
|
|
16
|
-
'Applicant'
|
|
17
|
-
]);
|
|
7
|
+
cannot('manage', ['Vacancy', 'Applicant']);
|
|
18
8
|
can('updateSubscriptionUser', 'Subscription');
|
|
19
9
|
can('manageAdmin', 'Reports');
|
|
20
10
|
};
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
export const defineRoleAbilitiesHeadOfDataAnalytics = async (can, cannot)=>{
|
|
1
|
+
export const defineRoleAbilitiesHeadOfDataAnalytics = async (can, cannot) => {
|
|
2
2
|
can('manage', 'all');
|
|
3
|
-
cannot([
|
|
4
|
-
|
|
5
|
-
'update'
|
|
6
|
-
], 'Payout');
|
|
7
|
-
cannot([
|
|
8
|
-
'release',
|
|
9
|
-
'reverse',
|
|
10
|
-
'deletePayoutChargeLine'
|
|
11
|
-
], 'Payout');
|
|
3
|
+
cannot(['create', 'update'], 'Payout');
|
|
4
|
+
cannot(['release', 'reverse', 'deletePayoutChargeLine'], 'Payout');
|
|
12
5
|
cannot('cancelInvoice', 'Invoice');
|
|
13
6
|
cannot('markInvoice', 'Invoice');
|
|
14
7
|
cannot('update', 'Host', 'accountManagerId');
|
|
15
|
-
cannot('manage', [
|
|
16
|
-
'Vacancy',
|
|
17
|
-
'Applicant'
|
|
18
|
-
]);
|
|
8
|
+
cannot('manage', ['Vacancy', 'Applicant']);
|
|
19
9
|
};
|
|
@@ -1 +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,
|
|
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,23 +1,12 @@
|
|
|
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([
|
|
5
|
-
'create',
|
|
6
|
-
'update',
|
|
7
|
-
'delete'
|
|
8
|
-
], 'User', undefined, {
|
|
4
|
+
cannot(['create', 'update', 'delete'], 'User', undefined, {
|
|
9
5
|
groups: {
|
|
10
|
-
hasSome: [
|
|
11
|
-
|
|
12
|
-
]
|
|
13
|
-
}
|
|
6
|
+
hasSome: [...OWNER_ROLES],
|
|
7
|
+
},
|
|
14
8
|
});
|
|
15
|
-
cannot('update', 'Host', [
|
|
16
|
-
|
|
17
|
-
]);
|
|
18
|
-
cannot('manage', [
|
|
19
|
-
'Vacancy',
|
|
20
|
-
'Applicant'
|
|
21
|
-
]);
|
|
9
|
+
cannot('update', 'Host', ['accountManagerId']);
|
|
10
|
+
cannot('manage', ['Vacancy', 'Applicant']);
|
|
22
11
|
can('manageAdmin', 'Reports');
|
|
23
12
|
};
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
export const defineRoleAbilitiesHeadOfFinance = async (can, cannot)=>{
|
|
1
|
+
export const defineRoleAbilitiesHeadOfFinance = async (can, cannot) => {
|
|
2
2
|
can('manage', 'all');
|
|
3
|
-
cannot('update', 'Host', [
|
|
4
|
-
|
|
5
|
-
]);
|
|
6
|
-
cannot('manage', [
|
|
7
|
-
'Vacancy',
|
|
8
|
-
'Applicant'
|
|
9
|
-
]);
|
|
3
|
+
cannot('update', 'Host', ['accountManagerId']);
|
|
4
|
+
cannot('manage', ['Vacancy', 'Applicant']);
|
|
10
5
|
can('manageAdmin', 'Reports');
|
|
11
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-of-human-resources.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-human-resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,uCAAuC,GACnD,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"head-of-human-resources.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-human-resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,uCAAuC,GACnD,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAU5C,CAAA"}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { OWNER_ROLES } from '../../constants.js';
|
|
2
|
-
export const defineRoleAbilitiesHeadOfHumanResources = async (can, cannot)=>{
|
|
2
|
+
export const defineRoleAbilitiesHeadOfHumanResources = async (can, cannot) => {
|
|
3
3
|
can('manage', 'all');
|
|
4
|
-
cannot([
|
|
5
|
-
'create',
|
|
6
|
-
'update',
|
|
7
|
-
'delete'
|
|
8
|
-
], 'User', undefined, {
|
|
4
|
+
cannot(['create', 'update', 'delete'], 'User', undefined, {
|
|
9
5
|
groups: {
|
|
10
|
-
hasSome: [
|
|
11
|
-
|
|
12
|
-
]
|
|
13
|
-
}
|
|
6
|
+
hasSome: [...OWNER_ROLES],
|
|
7
|
+
},
|
|
14
8
|
});
|
|
15
|
-
cannot('update', 'Host', [
|
|
16
|
-
'accountManagerId'
|
|
17
|
-
]);
|
|
9
|
+
cannot('update', 'Host', ['accountManagerId']);
|
|
18
10
|
can('manageAdmin', 'Reports');
|
|
19
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-of-marketing.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-marketing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,kCAAkC,GAC9C,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"head-of-marketing.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-marketing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,eAAO,MAAM,kCAAkC,GAC9C,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAU5C,CAAA"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
export const defineRoleAbilitiesHeadOfMarketing = async (can, cannot)=>{
|
|
1
|
+
export const defineRoleAbilitiesHeadOfMarketing = async (can, cannot) => {
|
|
2
2
|
can('manage', 'all');
|
|
3
|
-
cannot([
|
|
4
|
-
|
|
5
|
-
'update'
|
|
6
|
-
], 'Payout');
|
|
7
|
-
cannot([
|
|
8
|
-
'release',
|
|
9
|
-
'reverse',
|
|
10
|
-
'deletePayoutChargeLine'
|
|
11
|
-
], 'Payout');
|
|
3
|
+
cannot(['create', 'update'], 'Payout');
|
|
4
|
+
cannot(['release', 'reverse', 'deletePayoutChargeLine'], 'Payout');
|
|
12
5
|
cannot('cancelInvoice', 'Invoice');
|
|
13
6
|
cannot('markInvoice', 'Invoice');
|
|
14
|
-
cannot('update', 'Host', [
|
|
15
|
-
|
|
16
|
-
]);
|
|
17
|
-
cannot('manage', [
|
|
18
|
-
'Vacancy',
|
|
19
|
-
'Applicant'
|
|
20
|
-
]);
|
|
7
|
+
cannot('update', 'Host', ['accountManagerId']);
|
|
8
|
+
cannot('manage', ['Vacancy', 'Applicant']);
|
|
21
9
|
can('manageAdmin', 'Reports');
|
|
22
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-of-operations.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-operations.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,
|
|
1
|
+
{"version":3,"file":"head-of-operations.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-operations.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,kBAO5C,CAAA"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
export const defineRoleAbilitiesHeadOfOperations = async (can, cannot)=>{
|
|
1
|
+
export const defineRoleAbilitiesHeadOfOperations = async (can, cannot) => {
|
|
2
2
|
can('manage', 'all');
|
|
3
|
-
cannot('update', 'Host', [
|
|
4
|
-
|
|
5
|
-
]);
|
|
6
|
-
cannot('manage', [
|
|
7
|
-
'Vacancy',
|
|
8
|
-
'Applicant'
|
|
9
|
-
]);
|
|
3
|
+
cannot('update', 'Host', ['accountManagerId']);
|
|
4
|
+
cannot('manage', ['Vacancy', 'Applicant']);
|
|
10
5
|
can('updateSubscriptionUser', 'Subscription');
|
|
11
6
|
can('manageAdmin', 'Reports');
|
|
12
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-of-product.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-product.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,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,
|
|
1
|
+
{"version":3,"file":"head-of-product.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-product.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,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,kBAW5C,CAAA"}
|
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
import { OWNER_ROLES } from '../../constants.js';
|
|
2
|
-
export const defineRoleAbilitiesHeadOfProduct = async (can, cannot)=>{
|
|
2
|
+
export const defineRoleAbilitiesHeadOfProduct = async (can, cannot) => {
|
|
3
3
|
can('manage', 'all');
|
|
4
|
-
cannot([
|
|
5
|
-
'create',
|
|
6
|
-
'update',
|
|
7
|
-
'delete'
|
|
8
|
-
], 'User', undefined, {
|
|
4
|
+
cannot(['create', 'update', 'delete'], 'User', undefined, {
|
|
9
5
|
groups: {
|
|
10
|
-
hasSome: [
|
|
11
|
-
|
|
12
|
-
]
|
|
13
|
-
}
|
|
6
|
+
hasSome: [...OWNER_ROLES],
|
|
7
|
+
},
|
|
14
8
|
});
|
|
15
|
-
cannot('update', 'Host', [
|
|
16
|
-
|
|
17
|
-
]);
|
|
18
|
-
cannot('manage', [
|
|
19
|
-
'Vacancy',
|
|
20
|
-
'Applicant'
|
|
21
|
-
]);
|
|
9
|
+
cannot('update', 'Host', ['accountManagerId']);
|
|
10
|
+
cannot('manage', ['Vacancy', 'Applicant']);
|
|
22
11
|
can('manageAdmin', 'Reports');
|
|
23
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"head-of-sales.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-sales.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,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"head-of-sales.d.ts","sourceRoot":"","sources":["../../../../src/authorization/roles/admin/head-of-sales.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,EACtC,QAAQ,cAAc,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,kBAU5C,CAAA"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
export const defineRoleAbilitiesHeadOfSales = async (can, cannot)=>{
|
|
1
|
+
export const defineRoleAbilitiesHeadOfSales = async (can, cannot) => {
|
|
2
2
|
can('manage', 'all');
|
|
3
|
-
cannot([
|
|
4
|
-
|
|
5
|
-
'update'
|
|
6
|
-
], 'Payout');
|
|
7
|
-
cannot([
|
|
8
|
-
'release',
|
|
9
|
-
'reverse',
|
|
10
|
-
'deletePayoutChargeLine'
|
|
11
|
-
], 'Payout');
|
|
3
|
+
cannot(['create', 'update'], 'Payout');
|
|
4
|
+
cannot(['release', 'reverse', 'deletePayoutChargeLine'], 'Payout');
|
|
12
5
|
cannot('cancelInvoice', 'Invoice');
|
|
13
6
|
cannot('markInvoice', 'Invoice');
|
|
14
|
-
cannot('update', 'Host', [
|
|
15
|
-
|
|
16
|
-
]);
|
|
17
|
-
cannot('manage', [
|
|
18
|
-
'Vacancy',
|
|
19
|
-
'Applicant'
|
|
20
|
-
]);
|
|
7
|
+
cannot('update', 'Host', ['accountManagerId']);
|
|
8
|
+
cannot('manage', ['Vacancy', 'Applicant']);
|
|
21
9
|
can('manageAdmin', 'Reports');
|
|
22
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocumentsFields } from '../../utils.js';
|
|
2
|
-
export const defineRoleAbilitiesHumanResourceExecutive = async (can, cannot)=>{
|
|
2
|
+
export const defineRoleAbilitiesHumanResourceExecutive = async (can, cannot) => {
|
|
3
3
|
can('read', [
|
|
4
4
|
'Subscription',
|
|
5
5
|
'Invoice',
|
|
@@ -17,22 +17,15 @@ export const defineRoleAbilitiesHumanResourceExecutive = async (can, cannot)=>{
|
|
|
17
17
|
'Discount',
|
|
18
18
|
'PlatformConfig',
|
|
19
19
|
'Vacancy',
|
|
20
|
-
'Applicant'
|
|
21
|
-
]);
|
|
22
|
-
cannot('read', [
|
|
23
|
-
'User'
|
|
24
|
-
], [
|
|
25
|
-
'documents'
|
|
20
|
+
'Applicant',
|
|
26
21
|
]);
|
|
22
|
+
cannot('read', ['User'], ['documents']);
|
|
27
23
|
cannot('create', 'Business');
|
|
28
24
|
cannot('read', 'User', [
|
|
29
25
|
...getDocumentsFields('identification'),
|
|
30
26
|
...getDocumentsFields('drivingHistory'),
|
|
31
27
|
...getDocumentsFields('financial'),
|
|
32
|
-
...getDocumentsFields('offerLetter')
|
|
33
|
-
]);
|
|
34
|
-
can('manage', [
|
|
35
|
-
'Vacancy',
|
|
36
|
-
'Applicant'
|
|
28
|
+
...getDocumentsFields('offerLetter'),
|
|
37
29
|
]);
|
|
30
|
+
can('manage', ['Vacancy', 'Applicant']);
|
|
38
31
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocumentsFields } from '../../utils.js';
|
|
2
|
-
export const defineRoleAbilitiesMarketingExecutive = async (can, cannot)=>{
|
|
2
|
+
export const defineRoleAbilitiesMarketingExecutive = async (can, cannot) => {
|
|
3
3
|
can('read', [
|
|
4
4
|
'Subscription',
|
|
5
5
|
'Cycle',
|
|
@@ -16,7 +16,7 @@ export const defineRoleAbilitiesMarketingExecutive = async (can, cannot)=>{
|
|
|
16
16
|
'PaymentLink',
|
|
17
17
|
'Invoice',
|
|
18
18
|
'Transaction',
|
|
19
|
-
'Refund'
|
|
19
|
+
'Refund',
|
|
20
20
|
]);
|
|
21
21
|
can('manage', 'Coupon');
|
|
22
22
|
can('readPricingInput', 'Vehicle');
|
|
@@ -25,10 +25,7 @@ export const defineRoleAbilitiesMarketingExecutive = async (can, cannot)=>{
|
|
|
25
25
|
...getDocumentsFields('identification'),
|
|
26
26
|
...getDocumentsFields('drivingHistory'),
|
|
27
27
|
...getDocumentsFields('financial'),
|
|
28
|
-
...getDocumentsFields('offerLetter')
|
|
29
|
-
]);
|
|
30
|
-
cannot('read', [
|
|
31
|
-
'Vacancy',
|
|
32
|
-
'Applicant'
|
|
28
|
+
...getDocumentsFields('offerLetter'),
|
|
33
29
|
]);
|
|
30
|
+
cannot('read', ['Vacancy', 'Applicant']);
|
|
34
31
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDocumentsFields } from '../../utils.js';
|
|
2
|
-
export const defineRoleAbilitiesProductManager = async (can, cannot)=>{
|
|
2
|
+
export const defineRoleAbilitiesProductManager = async (can, cannot) => {
|
|
3
3
|
can('read', [
|
|
4
4
|
'Subscription',
|
|
5
5
|
'Cycle',
|
|
@@ -11,20 +11,17 @@ export const defineRoleAbilitiesProductManager = 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', [
|
|
27
|
-
'Vacancy',
|
|
28
|
-
'Applicant'
|
|
29
|
-
]);
|
|
26
|
+
cannot('read', ['Vacancy', 'Applicant']);
|
|
30
27
|
};
|