Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Field NameTypeMandatoryUniqueIndexedDescription
_idMongo IDYESYESYESMongo Record ID
usernameStringYESYESYESThe UserName
passwordHashYESNONOThe User Password
firstNameStringYESNONOThe User First Name
lastNameStringYESNONOThe User Last Name
emailStringYESYESYESThe User Email
statusStringYESNONOThe User Status pendingNew or active
profileObjectNONONOAdditional User Info.
configObjectNONONO



Field NameTypeMandatoryUniqueIndexedDescription

allowedTenants

ArrayNONONOSub tenant access
keysObjectYESNONO Overridden ACL Keys
packagesObjectNONONO Overridden ACL Packages



Field NameTypeMandatoryUniqueIndexedDescription
%packageName%ObjectNONO

NO





Field NameTypeMandatoryUniqueIndexedDescription
aclObjectNONONO



Field NameTypeMandatoryUniqueIndexedDescription
accessBoolean or ArrayNONONO
apisPermissionStringNONONO
apisObjectNONONO



Field NameTypeMandatoryUniqueIndexedDescription
%apiRoute%ObjectYESNONO



Field NameTypeMandatoryUniqueIndexedDescription
accessObjectNONONO







tenantObject YES NONO 



Field NameTypeMandatoryUniqueIndexedDescription
idStringYESNONOTenant ID
codeStringYESNONOTenant Code 


groupsArrayYESNONOArray Of Group Codes
tsTime stampYESNONOrecord created timestamp


Sample

  1. This User has only access to the main tenant "DBTN" with the pin code (5511) but has no access to subtenants

...

Code Block
languagejs
titleUser Record Sample
var data = {
	"_id": ObjectId("5d308c68687aaf05b1c24097"),
	"locked": true,
	"username": "owner",
	"password": "$2a$12$geJJfv33wkYIXEAlDkeeuOgiQ6y6MjP/YxbqLdHdDSK7LDG.7n7Pq",
	"firstName": "owner",
	"lastName": "owner",
	"email": "me@localhost.com",
	"ts": Double(1563462760715.0),
	"status": "active",
	"profile": {},
	"groups": [
		"owner"
	],
	"config": {
		"packages": {},
		"keys": {}
	},
	"tenant": {
		"id": "5c0e74ba9acc3c5a84a51259",
		"code": "DBTN"
		"pin": {
			"code": 5511,
			"allowed": true
		}
	},
	"lastLogin": Double(1564068005777.0)
};


        2. This user has access to the main tenant  "DBTN" in the group "Owner" and as well has access to subtenants like "TES1" with the code (5678) and group "sub"


Code Block
languagejs
titleUser Record Sample
{
	_id: ObjectId("5d3820639f9655752c03e340"),
	locked: true,
	username: "devop",
	firstName: "Fadi",
	lastName: "Nasr",
	email: "test@localhost.com",
	status: "active",
	config: {
		allowedTenants: [
			{
				tenant: {
					id: "5c0e74ba9acc3c5a84a51251",
					code: "TES1",
					pin: {
						code: "5678",
						allowed: true
					}
				},
				groups: [
					"sub"
				]
			},
			{
				tenant: {
					code: "TES0",
					id: "5c0e74ba9acc3c5a84a51259"
				}
			},
			{
				tenant: {
					id: "THYME_tID",
					code: "THYME_CODE",
					pin: {
						code: "5677",
						allowed: true
					}
				},
				groups: [
					"waiter"
				]
			},
			{
				tenant: {
					id: "ELVIRA_tID",
					code: "ELVIRA_CODE"
				},
				groups: [
					"manager"
				]
			}
		]
	},
	tenant: {
		id: "5c0e74ba9acc3c5a84a51259",
		code: "DBTN",
		pin: {
			code: "5621",
			allowed: true
		}
	},
	"groups": [
		"owner"
	],
}