forked from awslabs/fhir-works-on-aws-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRBACRules.ts
47 lines (43 loc) · 1.26 KB
/
RBACRules.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
import { RBACConfig } from 'fhir-works-on-aws-authz-rbac';
export const financialResources: string[] = [
'Coverage',
'CoverageEligibilityRequest',
'CoverageEligibilityResponse',
'EnrollmentRequest',
'EnrollmentResponse',
'Claim',
'ClaimResponse',
'Invoice',
'PaymentNotice',
'PaymentReconciliation',
'Account',
'ChargeItem',
'ChargeItemDefinition',
'Contract',
'ExplanationOfBenefit',
'InsurancePlan',
];
const RBACRules = (baseResources: string[]): RBACConfig => {
return {
version: 1.0,
groupRules: {
practitioner: {
operations: ['create', 'read', 'update', 'delete', 'vread', 'search-type', 'transaction'],
resources: baseResources,
},
'non-practitioner': {
operations: ['read', 'vread', 'search-type'],
resources: financialResources,
},
auditor: {
operations: ['read', 'vread', 'search-type'],
resources: ['Patient'],
},
},
};
};
export default RBACRules;