diff --git a/src/Database/Ability.php b/src/Database/Ability.php index 352f1f59..fc56263c 100644 --- a/src/Database/Ability.php +++ b/src/Database/Ability.php @@ -118,6 +118,9 @@ public function scopeForModel($query, Model $model, $strict = false) $query->orWhere('entity_id', $model->getKey()); } + // If the model does not exist, we want to search for blanket abilities + // that cover all instances of this model. If it does exist, we only + // want to find blanket abilities if we're not using strict mode. if ( ! $model->exists || ! $strict) { $query->whereNull('entity_id'); }