Skip to content

Commit

Permalink
Merge pull request #333 from GM-Alex/next
Browse files Browse the repository at this point in the history
Bump version 2.2.13
  • Loading branch information
GM-Alex authored Apr 15, 2021
2 parents 445fc05 + 5aaaefd commit b7f8d90
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "User Access Manager plugin for Wordpress",
"type": "wordpress-plugin",
"license": "GPL-2.0",
"version": "2.2.12",
"version": "2.2.13",
"authors": [
{
"name": "Alexander Schneider",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "user-access-manager",
"version": "2.2.12",
"version": "2.2.13",
"description": "[![Build Status](https://travis-ci.org/GM-Alex/user-access-manager.svg)](https://travis-ci.org/GM-Alex/user-access-manager)",
"main": "index.js",
"directories": {
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: admin, access, member area, members, member, member access, page, pages, post, posts, private, privacy, restrict, user, user access manager, user management
Requires at least: 4.7
Tested up to: 5.7
Stable tag: 2.2.12
Stable tag: 2.2.13

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

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

Version Date Changes

2.2.13 2021/04/15 Fix not logged in user handling.
Type fix for showEditLink.

2.2.12 2021/04/14 Fix warning.
Fix jquery deprecation warning.

Expand Down
19 changes: 16 additions & 3 deletions src/Access/AccessHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use UserAccessManager\Object\ObjectHandler;
use UserAccessManager\User\UserHandler;
use UserAccessManager\UserGroup\AbstractUserGroup;
use UserAccessManager\UserGroup\DynamicUserGroup;
use UserAccessManager\UserGroup\UserGroupHandler;
use UserAccessManager\UserGroup\UserGroupTypeException;
use UserAccessManager\Wrapper\Wordpress;
Expand Down Expand Up @@ -179,10 +180,22 @@ public function checkObjectAccess(?string $objectType, $objectId, $isAdmin = nul
) {
$access = true;
} else {
$access = true;
$membership = $this->userGroupHandler->getUserGroupsForObject($objectType, $objectId);
$access = $membership === []
|| array_intersect_key($membership, $this->getUserUserGroupsForObjectAccess($isAdmin)) !== []
&& $this->wordpress->isUserMemberOfBlog();

if (count($membership) > 0) {
$userGroupDiff = array_intersect_key(
$membership,
$this->getUserUserGroupsForObjectAccess($isAdmin)
);
$nonLoggedInGroupKey = DynamicUserGroup::USER_TYPE . '|'
. DynamicUserGroup::NOT_LOGGED_IN_USER_ID;

$access = count($userGroupDiff) > 0 && (
isset($userGroupDiff[$nonLoggedInGroupKey]) ||
$this->wordpress->isUserMemberOfBlog()
);
}
}

$this->objectAccess[$isAdmin][$objectType][$objectId] = $access;
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Frontend/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,6 @@ function (AbstractUserGroup $group) {
}
}

return $link;
return (string) $link;
}
}
2 changes: 1 addition & 1 deletion src/UserAccessManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*/
class UserAccessManager
{
const VERSION = '2.2.12';
const VERSION = '2.2.13';
const DB_VERSION = '1.6.1';

/**
Expand Down
2 changes: 1 addition & 1 deletion user-access-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: User Access Manager
* Plugin URI: https://wordpress.org/plugins/user-access-manager/
* Author URI: https://twitter.com/GM_Alex
* Version: 2.2.12
* Version: 2.2.13
* Requires PHP: 7.2
* Author: Alexander Schneider
* Description: Manage the access to your posts, pages, categories and files.
Expand Down

0 comments on commit b7f8d90

Please sign in to comment.