@jusbid/common-auth 1.0.0

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/index.js ADDED
@@ -0,0 +1,137 @@
1
+ const redis = require('@jusbid/redis');
2
+ const { logger } = require('@jusbid/logger');
3
+ const { permissions } = require("./scripts/permission");
4
+ const { UnauthorizedError } = require("@jusbid/error-handler")
5
+ const { questions } = require("./scripts/questionsSlug")
6
+ const { encryptToken } = require("@jusbid/utils");
7
+ const { propertyOnBoard } = require('./scripts/propertySlug');
8
+
9
+
10
+ async function getPermissions(roleName) {
11
+ /* const db = getConnection();
12
+ const RolePermission = db.model('roles', RoleSchema)
13
+
14
+ return await RolePermission.findOne({ name: roleName }); */
15
+ const token = encryptToken(process.env.MASTER_ENCRYPTION_KEY, process.env.MASTER_ENCRYPTION_IV, process.env.INTERNAL_TOKEN)
16
+ const permit = await fetch(`${process.env.AUTH_SERVICE_URL}/api/v1/auth/services/${roleName}`, {
17
+ headers: {
18
+ "Authenticate-Internal": `Bearer ${token}`
19
+ }
20
+ });
21
+ const permitData = await permit.json();
22
+ return permitData.success ? permitData.data : [];
23
+ }
24
+
25
+
26
+
27
+ /**
28
+ * Permission-check middleware.
29
+ *
30
+ * Expects roleDoc.permissions to look like:
31
+ * [{ module: "regions", fullAccess: false, features: { "location.region.view": true, ... } }]
32
+ *
33
+ * `features` keys are the FULL dotted action string (e.g. "location.region.view"),
34
+ * not just the tail ("view") — do not prefix them with `permission.module`.
35
+ */
36
+
37
+ // eslint-disable-next-line no-unused-vars
38
+ const canAccess = ({ module, action }) => {
39
+ return async (req, res, next) => {
40
+ try {
41
+ const roleName = req.headers["x-user-role"];
42
+
43
+ if (!roleName) {
44
+ throw new UnauthorizedError("Unauthorized")
45
+ }
46
+
47
+ const cacheKey = `role:permission:v2:${roleName}`;
48
+
49
+ // `action` is expected to already be the fully-qualified feature key
50
+ // stored under permission.features, e.g. "location.region.view".
51
+ // If callers pass it split (module: "location", action: "region.view"),
52
+ // reconstruct it the same way.
53
+ const field = action;
54
+
55
+ // 1. Check Redis first
56
+ let hasPermission = await redis.hGet(cacheKey, field);
57
+
58
+ // 2. Cache miss -> rebuild from Mongo if the key isn't cached at all
59
+ if (hasPermission === null) {
60
+
61
+ const exists = await redis.exists(cacheKey);
62
+
63
+ if (!exists) {
64
+
65
+ const roleDoc = await getPermissions(roleName);
66
+ const permissions = roleDoc?.permissions || [];
67
+
68
+ const hash = {};
69
+
70
+ for (const permission of permissions) {
71
+
72
+ // Normalize `features` to a plain object regardless of
73
+ // how the doc was fetched (Mongoose Map, lean plain
74
+ // object, or a subdocument with toObject()).
75
+ let featuresObj = permission.features;
76
+
77
+ if (featuresObj instanceof Map) {
78
+ featuresObj = Object.fromEntries(featuresObj);
79
+ } else if (featuresObj && typeof featuresObj.toObject === "function") {
80
+ featuresObj = featuresObj.toObject();
81
+ } else if (featuresObj && typeof featuresObj === "object") {
82
+ featuresObj = { ...featuresObj };
83
+ } else {
84
+ featuresObj = {};
85
+ }
86
+
87
+ for (const [featureKey, value] of Object.entries(featuresObj)) {
88
+ if (typeof featureKey !== "string") continue;
89
+ hash[featureKey] = value ? "1" : "0";
90
+ }
91
+
92
+ // fullAccess grants every feature under that module,
93
+ // regardless of the individual booleans.
94
+ if (permission.fullAccess) {
95
+ for (const featureKey of Object.keys(featuresObj)) {
96
+ hash[featureKey] = "1";
97
+ }
98
+ }
99
+ }
100
+
101
+ if (Object.keys(hash).length) {
102
+ await redis.hSet(cacheKey, hash);
103
+ // await redis.expire(cacheKey, 3600);
104
+ }
105
+
106
+ hasPermission = hash[field] ?? "0";
107
+ } else {
108
+ // Key exists but this particular field wasn't in it
109
+ // (i.e. an action not present in the role's feature set).
110
+ hasPermission = "0";
111
+ }
112
+ }
113
+
114
+ if (Number(hasPermission) !== 1) {
115
+ throw new UnauthorizedError("Permission Denied")
116
+ }
117
+
118
+ next();
119
+
120
+ } catch (error) {
121
+ logger.error(error);
122
+ next(error)
123
+ }
124
+ };
125
+ };
126
+
127
+
128
+ const getPermissionString = permissions;
129
+ const getQuestionSlug = questions;
130
+ const getPropertyMasterSlug = propertyOnBoard
131
+
132
+ module.exports = {
133
+ canAccess,
134
+ getPermissionString,
135
+ getQuestionSlug,
136
+ getPropertyMasterSlug
137
+ };
package/model/Role.js ADDED
@@ -0,0 +1,37 @@
1
+ const mongoose = require('mongoose');
2
+
3
+ const RoleSchema = new mongoose.Schema(
4
+ {
5
+ name: {
6
+ type: String,
7
+ required: true,
8
+ unique: true,
9
+ trim: true,
10
+ index: true,
11
+ },
12
+ permissions: {
13
+ type: [
14
+ {
15
+ features: {
16
+ type: Map,
17
+ of: Boolean,
18
+ required: true
19
+ },
20
+ fullAccess: { type: Boolean, required: true },
21
+ module: { type: String, required: true }
22
+ }
23
+ ],
24
+ default: [],
25
+ },
26
+ description: {
27
+ type: String,
28
+ trim: true,
29
+ },
30
+ },
31
+ {
32
+ timestamps: true,
33
+ collection: 'roles',
34
+ }
35
+ );
36
+
37
+ module.exports = RoleSchema;
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@jusbid/common-auth",
3
+ "version": "1.0.0",
4
+ "main": "index.js",
5
+ "private": false,
6
+ "dependencies": {
7
+ "redis": "^4.6.13",
8
+ "mongoose": "^8.2.0",
9
+ "@jusbid/redis": "1.0.0",
10
+ "@jusbid/error-handler": "1.0.0",
11
+ "@jusbid/utils": "1.0.0"
12
+ },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ }
16
+ }
@@ -0,0 +1,164 @@
1
+ /**
2
+ * Auto-generated flat permission-constants map from the original
3
+ * `permissions` catalogue.
4
+ *
5
+ * Naming rule: each key drops the leading namespace segment of the
6
+ * `action` string (e.g. "location.region.view" -> REGION_VIEW), except
7
+ * where the action only has two segments, in which case both are kept
8
+ * (e.g. "property.view" -> PROPERTY_VIEW) so the name stays meaningful.
9
+ * `module` is the original entry's groupId (matches your example, where
10
+ * "locations" was used rather than the "regions" id).
11
+ *
12
+ * Usage:
13
+ * const { permissions } = require('./permissions.constants');
14
+ * permissions.REGION_VIEW.action // "location.region.view"
15
+ * permissions.REGION_VIEW.module // "locations"
16
+ */
17
+
18
+ const permissions = {
19
+ REGION_VIEW: { action: "location.region.view", module: "locations" },
20
+ REGION_ADD: { action: "location.region.add", module: "locations" },
21
+ REGION_UPDATE: { action: "location.region.update", module: "locations" },
22
+ REGION_DELETE: { action: "location.region.delete", module: "locations" },
23
+
24
+ CITY_VIEW: { action: "location.city.view", module: "locations" },
25
+ CITY_ADD: { action: "location.city.add", module: "locations" },
26
+ CITY_UPDATE: { action: "location.city.update", module: "locations" },
27
+ CITY_DELETE: { action: "location.city.delete", module: "locations" },
28
+
29
+ STATE_VIEW: { action: "location.state.view", module: "locations" },
30
+ STATE_ADD: { action: "location.state.add", module: "locations" },
31
+ STATE_UPDATE: { action: "location.state.update", module: "locations" },
32
+ STATE_DELETE: { action: "location.state.delete", module: "locations" },
33
+
34
+ COUNTRY_VIEW: { action: "location.country.view", module: "locations" },
35
+ COUNTRY_ADD: { action: "location.country.add", module: "locations" },
36
+ COUNTRY_UPDATE: { action: "location.country.update", module: "locations" },
37
+ COUNTRY_DELETE: { action: "location.country.delete", module: "locations" },
38
+
39
+ PINCODES_VIEW: { action: "location.pincodes.view", module: "locations" },
40
+ PINCODES_ADD: { action: "location.pincodes.add", module: "locations" },
41
+ PINCODES_UPDATE: { action: "location.pincodes.update", module: "locations" },
42
+ PINCODES_DELETE: { action: "location.pincodes.delete", module: "locations" },
43
+
44
+ PROPERTY_CATEGORY_VIEW: { action: "property.property-category.view", module: "property-master" },
45
+ PROPERTY_CATEGORY_ADD: { action: "property.property-category.add", module: "property-master" },
46
+ PROPERTY_CATEGORY_UPDATE: { action: "property.property-category.update", module: "property-master" },
47
+ PROPERTY_CATEGORY_DELETE: { action: "property.property-category.delete", module: "property-master" },
48
+
49
+ PROPERTY_VIEWS_VIEW: { action: "property.location.property-views.view", module: "property-master" },
50
+ PROPERTY_VIEWS_ADD: { action: "property.location.property-views.add", module: "property-master" },
51
+ PROPERTY_VIEWS_UPDATE: { action: "property.location.property-views.update", module: "property-master" },
52
+ PROPERTY_VIEWS_DELETE: { action: "property.location.property-views.delete", module: "property-master" },
53
+
54
+ PROPERTY_AMENITIES_CATALOGUE_VIEW: { action: "property.amenities-catalogue.view", module: "property-master" },
55
+ PROPERTY_AMENITIES_CATALOGUE_ADD: { action: "property.amenities-catalogue.add", module: "property-master" },
56
+ PROPERTY_AMENITIES_CATALOGUE_UPDATE: { action: "property.amenities-catalogue.update", module: "property-master" },
57
+ PROPERTY_AMENITIES_CATALOGUE_DELETE: { action: "property.amenities-catalogue.delete", module: "property-master" },
58
+
59
+ PROPERTY_VIEW: { action: "property.view", module: "property-management" },
60
+ PROPERTY_ADD: { action: "property.add", module: "property-management" },
61
+ PROPERTY_UPDATE: { action: "property.update", module: "property-management" },
62
+ PROPERTY_DELETE: { action: "property.delete", module: "property-management" },
63
+ PROPERTY_ONBOARD: { action: "property.onboard", module: "property-management" },
64
+
65
+ MASTERS_VIEW: { action: "masters.view", module: "masters" },
66
+
67
+ BUYOUT_REASONS_VIEW: { action: "masters.buyout-reasons.view", module: "masters" },
68
+ BUYOUT_REASONS_ADD: { action: "masters.buyout-reasons.add", module: "masters" },
69
+ BUYOUT_REASONS_UPDATE: { action: "masters.buyout-reasons.update", module: "masters" },
70
+ BUYOUT_REASONS_DELETE: { action: "masters.buyout-reasons.delete", module: "masters" },
71
+
72
+ TENANT_VIEW: { action: "user.tenant.view", module: "user-management" },
73
+ TENANT_ADD: { action: "user.tenant.add", module: "user-management" },
74
+ TENANT_UPDATE: { action: "user.tenant.update", module: "user-management" },
75
+ TENANT_DELETE: { action: "user.tenant.delete", module: "user-management" },
76
+
77
+ CUSTOMER_VIEW: { action: "user.customer.view", module: "user-management" },
78
+ CUSTOMER_ADD: { action: "user.customer.add", module: "user-management" },
79
+ CUSTOMER_UPDATE: { action: "user.customer.update", module: "user-management" },
80
+ CUSTOMER_DELETE: { action: "user.customer.delete", module: "user-management" },
81
+
82
+ BDM_ASSIGN: { action: "user.bdm.assign", module: "user-heirarchy" },
83
+
84
+ USER_VIEW: { action: "user.view", module: "user-management" },
85
+ USER_ADD: { action: "user.add", module: "user-management" },
86
+ USER_UPDATE: { action: "user.update", module: "user-management" },
87
+ USER_DELETE: { action: "user.delete", module: "user-management" },
88
+
89
+ ROLE_CONFIGURATION_VIEW: { action: "role-configuration.view", module: "role-management" },
90
+ ROLE_CONFIGURATION_ADD: { action: "role-configuration.add", module: "role-management" },
91
+ ROLE_CONFIGURATION_UPDATE: { action: "role-configuration.update", module: "role-management" },
92
+ ROLE_CONFIGURATION_DELETE: { action: "role-configuration.delete", module: "role-management" },
93
+
94
+ ROOM_AMENITIES_CATALOGUE_VIEW: { action: "property.room.room-amenities-catalogue.view", module: "room-master" },
95
+ ROOM_AMENITIES_CATALOGUE_ADD: { action: "property.room.room-amenities-catalogue.add", module: "room-master" },
96
+ ROOM_AMENITIES_CATALOGUE_UPDATE: { action: "property.room.room-amenities-catalogue.update", module: "room-master" },
97
+ ROOM_AMENITIES_CATALOGUE_DELETE: { action: "property.room.room-amenities-catalogue.delete", module: "room-master" },
98
+
99
+ ROOM_BOOKING_VIEW: { action: "property.room-booking.view", module: "property" },
100
+ ROOM_BOOKING_ADD: { action: "property.room-booking.add", module: "property" },
101
+ ROOM_BOOKING_UPDATE: { action: "property.room-booking.update", module: "property" },
102
+ ROOM_BOOKING_DELETE: { action: "property.room-booking.delete", module: "property" },
103
+
104
+ ROOM_STATS_VIEW: { action: "property.room.stats.view", module: "property" },
105
+
106
+ ROOM_VIEW: { action: "property.room.view", module: "property" },
107
+ ROOM_ADD: { action: "property.room.add", module: "property" },
108
+ ROOM_UPDATE: { action: "property.room.update", module: "property" },
109
+ ROOM_DELETE: { action: "property.room.delete", module: "property" },
110
+
111
+ ADDITIONAL_SPACE_VIEW: { action: "property.additional-space.view", module: "property" },
112
+ ADDITIONAL_SPACE_ADD: { action: "property.additional-space.add", module: "property" },
113
+ ADDITIONAL_SPACE_UPDATE: { action: "property.additional-space.update", module: "property" },
114
+ ADDITIONAL_SPACE_DELETE: { action: "property.additional-space.delete", module: "property" },
115
+
116
+ AMENITY_CATEGORY_VIEW: { action: "property.amenity-category.view", module: "property" },
117
+ AMENITY_CATEGORY_ADD: { action: "property.amenity-category.add", module: "property" },
118
+ AMENITY_CATEGORY_UPDATE: { action: "property.amenity-category.update", module: "property" },
119
+ AMENITY_CATEGORY_DELETE: { action: "property.amenity-category.delete", module: "property" },
120
+
121
+ BATHROOM_TYPE_VIEW: { action: "property.bathroom-type.view", module: "property" },
122
+ BATHROOM_TYPE_ADD: { action: "property.bathroom-type.add", module: "property" },
123
+ BATHROOM_TYPE_UPDATE: { action: "property.bathroom-type.update", module: "property" },
124
+ BATHROOM_TYPE_DELETE: { action: "property.bathroom-type.delete", module: "property" },
125
+
126
+ BED_OPTIONS_VIEW: { action: "property.bed-options.view", module: "property" },
127
+ BED_OPTIONS_ADD: { action: "property.bed-options.add", module: "property" },
128
+ BED_OPTIONS_UPDATE: { action: "property.bed-options.update", module: "property" },
129
+ BED_OPTIONS_DELETE: { action: "property.bed-options.delete", module: "property" },
130
+
131
+ HOUSE_RULE_VIEW: { action: "property.house-rule.view", module: "property" },
132
+ HOUSE_RULE_ADD: { action: "property.house-rule.add", module: "property" },
133
+ HOUSE_RULE_UPDATE: { action: "property.house-rule.update", module: "property" },
134
+ HOUSE_RULE_DELETE: { action: "property.house-rule.delete", module: "property" },
135
+
136
+ LANGUAGE_VIEW: { action: "common.language.view", module: "common" },
137
+ LANGUAGE_ADD: { action: "common.language.add", module: "common" },
138
+ LANGUAGE_UPDATE: { action: "common.language.update", module: "common" },
139
+ LANGUAGE_DELETE: { action: "common.language.delete", module: "common" },
140
+
141
+
142
+ // Additional Room Config
143
+ ADDITIONAL_ROOM_CONFIG_VIEW: { action: "property.additional-room-config.view", module: "property" },
144
+ ADDITIONAL_ROOM_CONFIG_ADD: { action: "property.additional-room-config.add", module: "property" },
145
+ ADDITIONAL_ROOM_CONFIG_UPDATE: { action: "property.additional-room-config.update", module: "property" },
146
+ ADDITIONAL_ROOM_CONFIG_DELETE: { action: "property.additional-room-config.delete", module: "property" },
147
+
148
+ CONFIG_MASTER_VIEW: { action: "master.config-master.view", module: "master" },
149
+ CONFIG_MASTER_ADD: { action: "master.config-master.add", module: "master" },
150
+ CONFIG_MASTER_UPDATE: { action: "master.config-master.update", module: "master" },
151
+ CONFIG_MASTER_DELETE: { action: "master.config-master.delete", module: "master" },
152
+
153
+ CONFIG_MASTER_DATA_VIEW: { action: "master.config-master-data.view", module: "master" },
154
+ CONFIG_MASTER_DATA_ADD: { action: "master.config-master-data.add", module: "master" },
155
+ CONFIG_MASTER_DATA_UPDATE: { action: "master.config-master-data.update", module: "master" },
156
+ CONFIG_MASTER_DATA_DELETE: { action: "master.config-master-data.delete", module: "master" },
157
+
158
+ STORAGE_PROVIDER_VIEW: { action: "storage.storage-provider.view", module: "storage" },
159
+ STORAGE_PROVIDER_ADD: { action: "storage.storage-provider.add", module: "storage" },
160
+ STORAGE_PROVIDER_UPDATE: { action: "storage.storage-provider.update", module: "storage" },
161
+ STORAGE_PROVIDER_DELETE: { action: "storage.storage-provider.delete", module: "storage" },
162
+ }
163
+
164
+ module.exports = { permissions }
@@ -0,0 +1,34 @@
1
+
2
+
3
+ /*
4
+ Here slugs are being used in common master / config master to identify the property master
5
+ we can create a mapping between the slug and the property onboard
6
+
7
+ */
8
+
9
+
10
+ const propertyOnBoard = {
11
+ PropertyType: "property-type",
12
+ BedOption: "bed-option",
13
+ BathroomType: "bathroom-type",
14
+ ViewType: "view-type",
15
+ PropertyAmenityType: "property-amenity-type",
16
+ RoomAmenityType: "room-amenity-type",
17
+ PropertyImageTag: "property-image-tag",
18
+ RoomType: "room-type",
19
+ RoomView: "room-view",
20
+ CheckInTime: "check-in-time",
21
+ CheckOutTime: "check-out-time",
22
+ BusinessOwnerType: "business-owner-type",
23
+ OwnedPropertyAddressProof: "owned-property-address-proof",
24
+ LeasedPropertyAddressProof: "leased-property-address-proof",
25
+ ManagedPropertyAddressProof: "managed-property-address-proof",
26
+ AddressProof: "address-proof",
27
+ PropertyDocument: "property-document",
28
+ ManagedPropertyDocument: "managed-property-document",
29
+ OwnedPropertyDocument: "owned-property-document"
30
+ }
31
+
32
+ module.exports = {
33
+ propertyOnBoard
34
+ }
@@ -0,0 +1,32 @@
1
+ /*
2
+ Slug for questions:
3
+ Additional Room Config
4
+ */
5
+ const questions = {
6
+ KITCHEN_ACCESS_DETAIL: 'kitchen-access-restrictions',
7
+ ROOM_BATHROOM_DETAIL: 'room-bathroom-access-detail',
8
+ ADDITIONAL_SPACE_DETAIL: 'additional-space-detail',
9
+ BEDROOM_DETAIL: 'bedroom_detail',
10
+ ADDITIONAL_SPACE_BEDROOM: 'additional-space-bedroom',
11
+ ADDITIONAL_SPACE_KITCHEN: 'additional-space-kitchen',
12
+ ADDITIONAL_SPACE_BATHROOM: 'additional-space-bathroom',
13
+ ADDITIONAL_SPACE_LIVING_ROOM: 'additional-space-living-room',
14
+
15
+ PROPERTY_RULES: 'property-rules',
16
+ KITCHEN_ACCESS_RESTRICTION: 'kitchen-access-restrictions',
17
+ BEDROOM_FACILITY: 'bedroom_facilities',
18
+ BEDROOM_ADDITIONAL_DETAIL: 'bedroom_additional_details',
19
+ BATHRROM_ADDITIONAL_DETAIL: 'bathroom_additional_details',
20
+ ADDITIONAL_SPACES_LIVING_ROOM: 'additional_spaces_living_room',
21
+ ADDITIONAL_SPACES_LOBBY_LOUNGE: 'additional_spaces_lobby_lounge',
22
+ ADDITIONAL_SPACES_HELPERS_ROOM: 'additional_spaces_helpers_room',
23
+ ADDITIONAL_SPACES_SWIMMING_POOL: 'additional_spaces_swimming_pool',
24
+ ADDITIONAL_SPACES_PARKING: 'additional_spaces_parking',
25
+ ADDITIONAL_SPACES_DRIVERS_ROOM: 'additional_spaces_drivers_room',
26
+ ADDITIONAL_SPACES_TERRACE: 'additional_spaces_terrace',
27
+ ADDITIONAL_SPACES_GARDEN: 'additional_spaces_garden',
28
+ ADDITIONAL_SPACES_DINING_AREA: 'additional_spaces_dining_area',
29
+
30
+ }
31
+
32
+ module.exports = { questions }
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Auto-generated from the original `permissions` catalogue.
3
+ * Shape matches RoleSchema.permissions:
4
+ * [{ module: String, fullAccess: Boolean, features: Map<String, Boolean> }]
5
+ *
6
+ * Usage:
7
+ * const { permissions } = require('./role-permissions.seed');
8
+ * await Role.create({ name: 'admin', permissions, description: '...' });
9
+ *
10
+ * Note: two source entries both had id "group" (User Management /
11
+ * Role Management). They were renamed to "user-management" and
12
+ * "role-management" here so `module` stays unique.
13
+ */
14
+
15
+ const permissions = [
16
+ {
17
+ "module": "regions",
18
+ "fullAccess": false,
19
+ "features": {
20
+ "location.region.view": false,
21
+ "location.region.add": false,
22
+ "location.region.update": false,
23
+ "location.region.delete": false
24
+ }
25
+ },
26
+ {
27
+ "module": "City",
28
+ "fullAccess": false,
29
+ "features": {
30
+ "location.city.view": false,
31
+ "location.city.add": false,
32
+ "location.city.update": false,
33
+ "location.city.delete": false
34
+ }
35
+ },
36
+ {
37
+ "module": "State",
38
+ "fullAccess": false,
39
+ "features": {
40
+ "location.state.view": false,
41
+ "location.state.add": false,
42
+ "location.state.update": false,
43
+ "location.state.delete": false
44
+ }
45
+ },
46
+ {
47
+ "module": "Country",
48
+ "fullAccess": false,
49
+ "features": {
50
+ "location.country.view": false,
51
+ "location.country.add": false,
52
+ "location.country.update": false,
53
+ "location.country.delete": false
54
+ }
55
+ },
56
+ {
57
+ "module": "Pincodes",
58
+ "fullAccess": false,
59
+ "features": {
60
+ "location.pincodes.view": false,
61
+ "location.pincodes.add": false,
62
+ "location.pincodes.update": false,
63
+ "location.pincodes.delete": false
64
+ }
65
+ },
66
+ {
67
+ "module": "property-category",
68
+ "fullAccess": false,
69
+ "features": {
70
+ "property.property-category.view": false,
71
+ "property.property-category.add": false,
72
+ "property.property-category.update": false,
73
+ "property.property-category.delete": false
74
+ }
75
+ },
76
+ {
77
+ "module": "Property-Views",
78
+ "fullAccess": false,
79
+ "features": {
80
+ "property.location.property-views.view": false,
81
+ "property.location.property-views.add": false,
82
+ "property.location.property-views.update": false,
83
+ "property.location.property-views.delete": false
84
+ }
85
+ },
86
+ {
87
+ "module": "amenities-Catalogue",
88
+ "fullAccess": false,
89
+ "features": {
90
+ "property.amenities-catalogue.view": false,
91
+ "property.amenities-catalogue.add": false,
92
+ "property.amenities-catalogue.update": false,
93
+ "property.amenities-catalogue.delete": false
94
+ }
95
+ },
96
+ {
97
+ "module": "Property-Management",
98
+ "fullAccess": false,
99
+ "features": {
100
+ "property.view": false,
101
+ "property.add": false,
102
+ "property.update": false,
103
+ "property.delete": false
104
+ }
105
+ },
106
+ {
107
+ "module": "masters",
108
+ "fullAccess": false,
109
+ "features": {
110
+ "masters.view": false,
111
+ "masters.buyout-reasons.view": false,
112
+ "masters.buyout-reasons.add": false,
113
+ "masters.buyout-reasons.update": false,
114
+ "masters.buyout-reasons.delete": false
115
+ }
116
+ },
117
+ {
118
+ "module": "tenant",
119
+ "fullAccess": false,
120
+ "features": {
121
+ "user.tenant.view": false,
122
+ "user.tenant.add": false,
123
+ "user.tenant.update": false,
124
+ "user.tenant.delete": false
125
+ }
126
+ },
127
+ {
128
+ "module": "customer",
129
+ "fullAccess": false,
130
+ "features": {
131
+ "user.customer.view": false,
132
+ "user.customer.add": false,
133
+ "user.customer.update": false,
134
+ "user.customer.delete": false
135
+ }
136
+ },
137
+ {
138
+ "module": "user-heirarchy",
139
+ "fullAccess": false,
140
+ "features": {
141
+ "user.bdm.assign": false
142
+ }
143
+ },
144
+ {
145
+ "module": "user-management",
146
+ "fullAccess": false,
147
+ "features": {
148
+ "user.view": false,
149
+ "user.add": false,
150
+ "user.update": false,
151
+ "user.delete": false
152
+ }
153
+ },
154
+ {
155
+ "module": "role-management",
156
+ "fullAccess": false,
157
+ "features": {
158
+ "role-configuration.view": false,
159
+ "role-configuration.add": false,
160
+ "role-configuration.update": false,
161
+ "role-configuration.delete": false
162
+ }
163
+ },
164
+ {
165
+ "module": "property-room-amenities-catalogue",
166
+ "fullAccess": false,
167
+ "features": {
168
+ "property.room.room-amenities-catalogue.view": false,
169
+ "property.room.room-amenities-catalogue.add": false,
170
+ "property.room.room-amenities-catalogue.update": false,
171
+ "property.room.room-amenities-catalogue.delete": false
172
+ }
173
+ },
174
+ {
175
+ "module": "property-booking",
176
+ "fullAccess": false,
177
+ "features": {
178
+ "property.room-booking.view": false,
179
+ "property.room-booking.add": false,
180
+ "property.room-booking.update": false,
181
+ "property.room-booking.delete": false
182
+ }
183
+ },
184
+ {
185
+ "module": "property-stats",
186
+ "fullAccess": false,
187
+ "features": {
188
+ "property.room.stats.view": false
189
+ }
190
+ },
191
+ {
192
+ "module": "property-room",
193
+ "fullAccess": false,
194
+ "features": {
195
+ "property.room.view": false,
196
+ "property.room.add": false,
197
+ "property.room.update": false,
198
+ "property.room.delete": false
199
+ }
200
+ }
201
+ ];
202
+
203
+ module.exports = { permissions };