- $hasPermission = userCan('book-update', $currentParent)
- && userCan('book-update', $newBook)
- && userCan('chapter-update', $model)
- && (!$hasNewParent || userCan('chapter-create', $newBook))
- && (!$hasNewParent || userCan('chapter-delete', $model));
+ $hasPermission = userCan(Permission::BookUpdate, $currentParent)
+ && userCan(Permission::BookUpdate, $newBook)
+ && userCan(Permission::ChapterUpdate, $model)
+ && (!$hasNewParent || userCan(Permission::ChapterCreate, $newBook))
+ && (!$hasNewParent || userCan(Permission::ChapterDelete, $model));