If there is a comma in the perm string, it's displayed on the permission page but user_access always return false.

e.g.

define('MY_PERM_STRING', 'string with, comma');
// hook perm
function mymodule_perm() {
  return array(MY_PERM_STRING);
}

// then, this function always return false, even if the permission is checked on admin/user/permissions
drupal_set_message('user_access(MY_PERM_STRING) returns ' .(user_access(MY_PERM_STRING)?'OK':'KO'));

Comments

dcaillibaud’s picture

I saw that the pb is because perms are stored in permission table with comma as separator...

I guess another separator (the "|" character could be better) need to change user.module line 506 (explode(', ', $row->perm)) and user.admin.inc line 567 (implode(', ', ...), but I let the core team evaluate all risks...

To solve my pb, I use the Single low-9 quotation mark utf8 character "‚" instead of comma in my perm string...

dcaillibaud’s picture

Issue tags: +access permissions

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.