Open SamuelY opened 8 years ago
I also had this issue. I'm not positive, but I believe the ===
may be the issue. Perhaps one of the id's is returned as an integer, and the other as a string? Changing to ==
allows it to function as expected.
I agree with @SamuelY. I think the issue stems from $perm being pulled from the user_permission table. $perm->id is the id from that table and not the id from the permissions table. However if you change it as suggested you get the correct id.
I find that hasPermission() have wrong in UserModel.php.
the function return ($perm->id !== null && $perm->id === $permId) ? true : false; should be modified as return ($perm->id !== null && $perm->permissionId === $permId) ? true : false;
I have a suggestion
hasPermission() return true only if the requested permission isn't expired
please check it