mirror of
https://github.com/friendica/friendica
synced 2025-04-22 04:30:10 +00:00
Issue 8882: Fixes permissions of pinned posts
This commit is contained in:
parent
f3934eb0c2
commit
8d0d6bcd0c
2 changed files with 15 additions and 12 deletions
|
@ -232,7 +232,18 @@ class Status extends BaseProfile
|
|||
$items = DBA::toArray($items_stmt);
|
||||
|
||||
if ($pager->getStart() == 0 && !empty($a->profile['uid'])) {
|
||||
$pinned_items = Item::selectPinned($a->profile['uid'], ['uri', 'pinned']);
|
||||
$condition = ['private' => [Item::PUBLIC, Item::UNLISTED]];
|
||||
if (remote_user()) {
|
||||
$permissionSets = DI::permissionSet()->selectByContactId(remote_user(), $a->profile['uid']);
|
||||
if (!empty($permissionSets)) {
|
||||
$condition = ['psid' => array_merge($permissionSets->column('id'),
|
||||
[DI::permissionSet()->getIdFromACL($a->profile['uid'], '', '', '', '')])];
|
||||
}
|
||||
} elseif ($a->profile['uid'] == local_user()) {
|
||||
$condition = [];
|
||||
}
|
||||
|
||||
$pinned_items = Item::selectPinned($a->profile['uid'], ['uri', 'pinned'], $condition);
|
||||
$pinned = Item::inArray($pinned_items);
|
||||
$items = array_merge($items, $pinned);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue