Taking the above examples, the code in user_admin_perm (below) will match "module_permission" with "my_module_permission" as the check is for the permission with a trailing comma.

  // Builds arrays for checked boxes for each role
  if (strpos($role_permissions[$rid], $perm .',') !== FALSE) {
    $status[$rid][] = $perm;
  }

Just as a suggestion, I implemented the code below which will test the permission with the preceding comma and space and the terminating comma (unless its the very first permission), matching permissions exactly.

  // Builds arrays for checked boxes for each role
  if (strpos($role_permissions[$rid], $perm .',') !== FALSE) {
    if (strpos(trim($role_permissions[$rid]), trim($perm) . ',') === 0) {
       //1st occurance, must be ok
       $status[$rid][] = $perm;
    }else if (strpos($role_permissions[$rid], ', ' . $perm . ',') !== FALSE) {
       //Full match on permission with begining and trailing comma
       $status[$rid][] = $perm;
    }
  }

Comments

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.