Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Debug::require_developer_login to use the ORM instead of raw SQL #10998

Open
sabina-talipova opened this issue Oct 18, 2023 · 2 comments

Comments

@sabina-talipova
Copy link
Contributor

sabina-talipova commented Oct 18, 2023

Description

It is necessary to partially update the code and implement the Datalist::filter instead of using a row SQL "where" clause.

See:

// @TODO - Rewrite safely using DataList::filter
$memberID = $_SESSION['loggedInAs'];
$permission = DB::prepared_query(
'
SELECT "ID" FROM "Permission"
INNER JOIN "Group_Members" ON "Permission"."GroupID" = "Group_Members"."GroupID"
WHERE "Permission"."Code" = ?
AND "Permission"."Type" = ?
AND "Group_Members"."MemberID" = ?',
[
'ADMIN', // Code
Permission::GRANT_PERMISSION, // Type
$memberID // MemberID
]
)->value();

@GuySartorelli
Copy link
Member

@sabina-talipova the title doesn't match the description. I think it got mixed up with #10997

@sabina-talipova
Copy link
Contributor Author

Updated.

@GuySartorelli GuySartorelli changed the title TODO: Debug::require_developer_login rewrite using DataList::filter Refactor Debug::require_developer_login to use the ORM instead of raw SQL Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants