Skip to content

Commit

Permalink
Temporary fix for permissions bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyzerner committed Sep 4, 2015
1 parent 9970c0b commit b3aee70
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Tag.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/*
* This file is part of Flarum.
*
Expand Down Expand Up @@ -123,7 +123,7 @@ public static function getIdsWhereCan($user, $permission)
}

$ids = [];
$hasGlobalPermission = $user->hasPermission($permission);
$hasGlobalPermission = $user->hasPermission($permission === 'view' ? 'forum.view' : $permission);

foreach ($tags as $tag) {
if (($hasGlobalPermission && ! $tag->is_restricted) || $user->hasPermission('tag' . $tag->id . '.' . $permission)) {
Expand All @@ -143,7 +143,7 @@ public static function getIdsWhereCannot($user, $permission)
}

$ids = [];
$hasGlobalPermission = $user->hasPermission($permission);
$hasGlobalPermission = $user->hasPermission($permission === 'view' ? 'forum.view' : $permission);

foreach ($tags as $tag) {
if (($tag->is_restricted || ! $hasGlobalPermission) && ! $user->hasPermission('tag' . $tag->id . '.' . $permission)) {
Expand Down

0 comments on commit b3aee70

Please sign in to comment.