Skip to content

Commit b7f8d90

Browse files
authored
Merge pull request #333 from GM-Alex/next
Bump version 2.2.13
2 parents 445fc05 + 5aaaefd commit b7f8d90

7 files changed

+25
-9
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "User Access Manager plugin for Wordpress",
44
"type": "wordpress-plugin",
55
"license": "GPL-2.0",
6-
"version": "2.2.12",
6+
"version": "2.2.13",
77
"authors": [
88
{
99
"name": "Alexander Schneider",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "user-access-manager",
3-
"version": "2.2.12",
3+
"version": "2.2.13",
44
"description": "[![Build Status](https://travis-ci.org/GM-Alex/user-access-manager.svg)](https://travis-ci.org/GM-Alex/user-access-manager)",
55
"main": "index.js",
66
"directories": {

readme.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
44
Tags: admin, access, member area, members, member, member access, page, pages, post, posts, private, privacy, restrict, user, user access manager, user management
55
Requires at least: 4.7
66
Tested up to: 5.7
7-
Stable tag: 2.2.12
7+
Stable tag: 2.2.13
88

99
With the "User Access Manager"-plugin you can manage the access to your posts, pages and files.
1010

@@ -59,6 +59,9 @@ Here you found the changes in each version.
5959

6060
Version Date Changes
6161

62+
2.2.13 2021/04/15 Fix not logged in user handling.
63+
Type fix for showEditLink.
64+
6265
2.2.12 2021/04/14 Fix warning.
6366
Fix jquery deprecation warning.
6467

src/Access/AccessHandler.php

+16-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use UserAccessManager\Object\ObjectHandler;
2424
use UserAccessManager\User\UserHandler;
2525
use UserAccessManager\UserGroup\AbstractUserGroup;
26+
use UserAccessManager\UserGroup\DynamicUserGroup;
2627
use UserAccessManager\UserGroup\UserGroupHandler;
2728
use UserAccessManager\UserGroup\UserGroupTypeException;
2829
use UserAccessManager\Wrapper\Wordpress;
@@ -179,10 +180,22 @@ public function checkObjectAccess(?string $objectType, $objectId, $isAdmin = nul
179180
) {
180181
$access = true;
181182
} else {
183+
$access = true;
182184
$membership = $this->userGroupHandler->getUserGroupsForObject($objectType, $objectId);
183-
$access = $membership === []
184-
|| array_intersect_key($membership, $this->getUserUserGroupsForObjectAccess($isAdmin)) !== []
185-
&& $this->wordpress->isUserMemberOfBlog();
185+
186+
if (count($membership) > 0) {
187+
$userGroupDiff = array_intersect_key(
188+
$membership,
189+
$this->getUserUserGroupsForObjectAccess($isAdmin)
190+
);
191+
$nonLoggedInGroupKey = DynamicUserGroup::USER_TYPE . '|'
192+
. DynamicUserGroup::NOT_LOGGED_IN_USER_ID;
193+
194+
$access = count($userGroupDiff) > 0 && (
195+
isset($userGroupDiff[$nonLoggedInGroupKey]) ||
196+
$this->wordpress->isUserMemberOfBlog()
197+
);
198+
}
186199
}
187200

188201
$this->objectAccess[$isAdmin][$objectType][$objectId] = $access;

src/Controller/Frontend/PostController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,6 @@ function (AbstractUserGroup $group) {
528528
}
529529
}
530530

531-
return $link;
531+
return (string) $link;
532532
}
533533
}

src/UserAccessManager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
*/
5151
class UserAccessManager
5252
{
53-
const VERSION = '2.2.12';
53+
const VERSION = '2.2.13';
5454
const DB_VERSION = '1.6.1';
5555

5656
/**

user-access-manager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: User Access Manager
44
* Plugin URI: https://wordpress.org/plugins/user-access-manager/
55
* Author URI: https://twitter.com/GM_Alex
6-
* Version: 2.2.12
6+
* Version: 2.2.13
77
* Requires PHP: 7.2
88
* Author: Alexander Schneider
99
* Description: Manage the access to your posts, pages, categories and files.

0 commit comments

Comments
 (0)