You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop checking permissions for updating billing account. We cannot do it properly if update has been made using M2M token with a negative userId. Instead we would rely on the fact, that if message to update billing account has been posted to Kafka, than service which posted the message already checked the permissions. And the processor only sync data back to legacy DB without permission check.
ref issue #12
Copy file name to clipboardExpand all lines: src/services/ProcessorService.js
-55Lines changed: 0 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,6 @@ const {
14
14
AUDIT_ACTION,
15
15
PERMISSION_TYPE,
16
16
BUGR_CONTEST_TYPE_ID,
17
-
ADMIN_ROLE,
18
17
COPILOT_ROLE,
19
18
MANAGER_ROLE,
20
19
ACCOUNT_MANAGER_ROLE,
@@ -57,58 +56,6 @@ async function checkBillingAccountExist (connection, billingAccountId) {
57
56
}
58
57
}
59
58
60
-
/**
61
-
* Check user is admin
62
-
* @param {Number} userId the user id.
63
-
* @returns {Boolean} true if user is admin, false otherwise
64
-
*/
65
-
asyncfunctioncheckUserIsAdmin(connection,userId){
66
-
constresult=awaitconnection.queryAsync(`select sr.description as role from common_oltp:security_user su, common_oltp:user_role_xref urx, common_oltp:security_roles sr where urx.login_id = su.login_id and sr.role_id = urx.role_id and su.login_id = ${userId}`)
directAccessIds=awaitconnection.queryAsync(`select p.project_id as id from time_oltp:project as p left join time_oltp:client_project as cp on p.project_id = cp.project_id left join time_oltp:client c on c.client_id = cp.client_id and (c.is_deleted = 0 or c.is_deleted is null) where p.active = 1 and p.start_date <= current and current <= p.end_date`)
directAccessIds=awaitconnection.queryAsync(`select p.project_id as id from time_oltp:project as p left join time_oltp:client_project as cp on p.project_id = cp.project_id left join time_oltp:client c on c.client_id = cp.client_id and (c.is_deleted = 0 or c.is_deleted is null) where p.active = 1 and p.start_date <= current and current <= p.end_date and p.active = 1 and p.project_id in (SELECT distinct project_id FROM time_oltp:project_manager p, time_oltp:user_account u WHERE p.user_account_id = u.user_account_id and p.active = 1 and upper(u.user_name) = upper('${userName}') union SELECT distinct project_id FROM time_oltp:project_worker p, time_oltp:user_account u WHERE p.start_date <= current and current <= p.end_date and p.active =1 and p.user_account_id = u.user_account_id and upper(u.user_name) = upper('${userName}'))`)
// fetch billing account id via security groups the user has permission with
105
-
constbillingAccountIds=awaitconnection.queryAsync(`select gaba.billing_account_id as id from tcs_catalog:group_associated_billing_accounts gaba, tcs_catalog:customer_group cg where gaba.group_id = cg.group_id and cg.archived<>1 and (cg.client_id in (select ca.client_id from tcs_catalog:customer_administrator ca where ca.user_id=${userId}) or cg.group_id in (select gm.group_id from tcs_catalog:group_member gm, tcs_catalog:customer_group g3 where gm.group_id=g3.group_id and (gm.use_group_default=0 and gm.specific_permission='FULL' or gm.use_group_default=1 and g3.default_permission='FULL') and gm.active=1 and gm.user_id=${userId}))`)
0 commit comments