Skip to content

Commit

Permalink
Fix a permission bug and set default permission to allow public viewing
Browse files Browse the repository at this point in the history
  • Loading branch information
wynnset committed Jul 2, 2019
1 parent d787021 commit 5f5cb95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions controller/class.tapestry-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class TapestryController
'TAPESTRY_NODE' => 'tapestry_node'
];
const NODE_PERMISSIONS = [
'DEFAULT' => [],
'DEFAULT' => [
'public' => ['read']
],
'OPTIONS' => [
'ADD' => 'add',
'READ' => 'read',
Expand Down Expand Up @@ -627,9 +629,9 @@ private function _currentUserIsAllowed($action, $nodeMetaId)
$userId = wp_get_current_user()->ID;
$groupIds = $this->_getGroupIdsOfUser($userId);

if ((TapestryUserRoles::isEditor())
&& (TapestryUserRoles::isAdministrator())
&& (TapestryUserRoles::isAuthorOfThePost($this->postId))
if ((TapestryUserRoles::isEditor()) ||
(TapestryUserRoles::isAdministrator()) ||
(TapestryUserRoles::isAuthorOfThePost($this->postId))
) {
return true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion templates/tapestry-d3
Submodule tapestry-d3 updated 1 files
+1 −0 tapestry.js

0 comments on commit 5f5cb95

Please sign in to comment.