How to disable ToggleColumn when user don't have update permission

I have implemented spatie permission package and when the user don't have edit/update permission on any resource the edit button is not visible. However, I have a toggle column in table which updates entries status which is still accessible when user don't have required permission.

Can anyone please help how can I make it disabled when the user don't have edit permission.
Screenshot_2023-11-26_at_5.18.11_PM.png
Solution
use
->disabled(function($record){
  // check for permission
}),
Was this page helpful?