Skip to content

Instantly share code, notes, and snippets.

View Justicea83's full-sized avatar
🎯
Focusing

Justice Arthur Justicea83

🎯
Focusing
View GitHub Profile
bool Account::isApprovedAccountantClient(SQLite& db, const int64_t accountID) {
const string domain = Account::getDomain(db,accountID);
const bool hasApprovedAccountantDomainAdmin = !DB::read(db,
"SELECT 1 "
"FROM sharedNameValuePairs s "
"INNER JOIN accounts sa ON sa.accountID = s.accountID "
"WHERE s.name GLOB 'expensify_adminPermissions_*'"
"AND s.ownerAccountID = (SELECT accountID FROM accounts WHERE email = " + SQ(domain) + ") "
"AND ( -- domain admin is EA! "