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
Comment #1
dcaillibaud commentedI 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...
Comment #2
dcaillibaud commented