laratrust
laratrust copied to clipboard
isAbleTo function is very slow
- Laravel Version: 10.0
- Laratrust Version: 8.0
Describe the bug
The isAbleTo
function is very slow. I have many users with many teams and many permissions. In one case, a user has more than 8000 rows in the permission_user
table. This is because of the user is assigned to many teams with a lot of permissions in every team. I'm checking permissions like that:
$user->isAbleTo(['permission_one', 'permission_two'], $teamId, true);
The DB query itself is super fast. I logged the raw query and tried that. But the isAbleTo
function is very slow (more than two seconds in this case).