Roles restriction not working
-
The role restriction always gives true.
Reproduce:
Limit quiz-maker to a specific role (say admin)
Login with a user having a different role (say editor)
De editor user still has access to Quiz MakerCause:
The function quiz_maker_capabilities incorrectly checks for the user’s role.foreach($current_user_roles as $r){ if(in_array($r, $ays_user_roles)){ $ishmar++; } }
The $ays_user_roles contains an array with the role names as Keys and value = true.
Fix:foreach($current_user_roles as $key => $r){ if(isset($ays_user_roles[$key])){ $ishmar++; } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Roles restriction not working’ is closed to new replies.