PluginProbe
User Access Manager / 2.3.4
User Access Manager v2.3.4
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
← All changes | src/Access/AccessHandler.php +3 -9 2.3.172.3.4 View file →
@@ -30,22 +30,16 @@
30 30 private UserGroupHandler $userGroupHandler
31 31 ) {
32 32 }
33 33
34 - private function hasAuthorAccess(string $objectType, int|string|null $objectId): bool
34 + private function hasAuthorAccess(string $objectType, int|string $objectId): bool
35 35 {
36 36 if ($this->mainConfig->authorsHasAccessToOwn() === true
37 37 && $this->objectHandler->isPostType($objectType)
38 38 ) {
39 39 $post = $this->objectHandler->getPost($objectId);
40 -
41 - if ($post === false) {
42 - return false;
43 - }
44 -
45 - $currentUserId = $this->wordpress->getCurrentUser()->ID;
46 - return $currentUserId !== 0
47 - && $currentUserId === (int) $post->post_author;
40 + return $post !== false
41 + && $this->wordpress->getCurrentUser()->ID === (int) $post->post_author;
48 42 }
49 43
50 44 return false;
51 45 }