Skip to content
Snippets Groups Projects
Commit 494aa87e authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Small change that reduces the number of SQL queries when a certain role has
  no permissions set.
parent 9c43f544
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -215,7 +215,7 @@ function user_access($string) {
** in a static variable.
*/
if (!$perm) {
if (isset($perm)) {
if ($user->uid) {
$perm = db_result(db_query("SELECT p.perm FROM role r, permission p WHERE r.rid = p.rid AND name = '%s'", $user->role), 0);
}
......
......@@ -215,7 +215,7 @@ function user_access($string) {
** in a static variable.
*/
if (!$perm) {
if (isset($perm)) {
if ($user->uid) {
$perm = db_result(db_query("SELECT p.perm FROM role r, permission p WHERE r.rid = p.rid AND name = '%s'", $user->role), 0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment