From 735bb4eec86ef897ab03a38c83dac6e781ea8819 Mon Sep 17 00:00:00 2001 From: Adrian Rollett Date: Fri, 23 Feb 2018 17:07:50 -0700 Subject: [PATCH] fix owner check --- bat.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bat.module b/bat.module index 33f4350b0..9f202fd00 100644 --- a/bat.module +++ b/bat.module @@ -196,7 +196,7 @@ function bat_entity_access(EntityInterface $entity, $operation, AccountInterface } // Then check an authenticated user's access to delete his own entities. - if ($account->id() && $entity_info->getKey('uid') !== FALSE && isset($entity->{$entity_info->getKey('uid')}) && $entity->{$entity_info->getKey('uid')} == $account->id()) { + if ($account->id() && $entity->getOwnerId() && $entity->getOwnerId() === $account->id()) { if ($account->hasPermission($operation . ' own ' . $entity_type . ' entities') || $account->hasPermission($operation . ' own ' . $entity_type . ' entities of bundle ' . $bundle_name)) { $rights[$account->id()][$cid][$operation] = TRUE;