allow search by technical flag
MODIFY
src/assets/server/rest/v1/schemas/user/users-get.json
src/assets/server/rest/v1/schemas/user/users-get.json
"sanitize": "mongo",
"pattern": "^[SABD](\\|[SABD])*$"
},
+ "Technical": {
+ "type": "boolean",
+ "sanitize": "mongo"
+ },
"Status": {
"type": "string",
"sanitize": "mongo",

MODIFY
src/authorization/AuthorizationsDefinition.ts
src/authorization/AuthorizationsDefinition.ts
@@ -72,14 +72,14 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
attributes: [
'id', 'name', 'firstName', 'email', 'role', 'status', 'issuer', 'createdOn', 'createdBy',
'lastChangedOn', 'lastChangedBy', 'eulaAcceptedOn', 'eulaAcceptedVersion', 'locale',
- 'billingData.customerID', 'billingData.lastChangedOn'
+ 'billingData.customerID', 'billingData.lastChangedOn', 'technical'
]
},
{
resource: Entity.USERS, action: Action.IN_ERROR,
attributes: [
'id', 'name', 'firstName', 'email', 'role', 'status', 'issuer',
- 'createdOn', 'lastChangedOn', 'errorCodeDetails', 'errorCode'
+ 'createdOn', 'lastChangedOn', 'errorCodeDetails', 'errorCode', 'technical'
]
},
{ resource: Entity.USER, action: Action.SYNCHRONIZE_BILLING_USER },
@@ -762,7 +762,7 @@ const AUTHORIZATION_DEFINITION: AuthorizationDefinition = {
attributes: [
'id', 'name', 'firstName', 'email', 'role', 'status', 'issuer', 'createdOn',
'lastChangedOn', 'eulaAcceptedOn', 'eulaAcceptedVersion', 'locale',
- 'billingData.customerID', 'billingData.lastChangedOn'
+ 'billingData.customerID', 'billingData.lastChangedOn', 'technical'
],
},
{

MODIFY
src/server/rest/v1/service/UserService.ts
src/server/rest/v1/service/UserService.ts
@@ -808,6 +808,7 @@ export default class UserService {
userIDs: (filteredRequest.UserID ? filteredRequest.UserID.split('|') : null),
roles: (filteredRequest.Role ? filteredRequest.Role.split('|') : null),
statuses: (filteredRequest.Status ? filteredRequest.Status.split('|') : null),
+ technical: (filteredRequest.Technical ? filteredRequest.Technical.split('|') : null),
excludeSiteID: filteredRequest.ExcludeSiteID,
...authorizationUsersFilters.filters
},

MODIFY
src/storage/mongodb/UserStorage.ts
src/storage/mongodb/UserStorage.ts
@@ -568,7 +568,7 @@ export default class UserStorage {
notificationsActive?: boolean; siteIDs?: string[]; excludeSiteID?: string; search?: string;
userIDs?: string[]; email?: string; issuer?: boolean; passwordResetHash?: string; roles?: string[];
statuses?: string[]; withImage?: boolean; billingUserID?: string; notSynchronizedBillingData?: boolean;
- withTestBillingData?: boolean; notifications?: any; noLoginSince?: Date;
+ withTestBillingData?: boolean; notifications?: any; noLoginSince?: Date; technical?: string[];
},
dbParams: DbParams, projectFields?: string[]): Promise<DataResult<User>> {
// Debug
@@ -652,6 +652,14 @@ export default class UserStorage {
{ 'billingData.liveMode': { $eq: expectedLiveMode } }
];
}
+ // Select (non) technical users
+ if (!Utils.isEmptyArray(params.technical)) {
+ const tValues = [];
+ params.technical.forEach((val: string) => {
+ tValues.push(val === 'true');
+ });
+ filters.technical = { $in: tValues };
+ }
// Add filters
aggregation.push({
$match: filters

MODIFY
src/types/requests/HttpUserRequest.ts
src/types/requests/HttpUserRequest.ts
@@ -38,6 +38,7 @@ export interface HttpUsersRequest extends HttpDatabaseRequest {
UserID: string;
Role: string;
Status: string;
+ Technical?: string;
ErrorType?: string;
VisualTagID?: string;
ExcludeSiteID: string;

allow search by technical flag